hi, $db_select = @mysql_select_db('test','$db_connect'); i think the problem is in this statement... as far as i know mysql_connect returns int.. and hence u shouldn't pass it as string... i.e. in single quotes... try removing it.. most probably it sould work bye, Gaurav Rustogi --- Raj <fmgnt@xxxxxxxxxxxxxx> wrote: > I am faceing a strange problem in this code plz > help me > > Sukalyan > > > > <?php > $db_connect = @mysql_connect('localhost', 'root', > ''); > $db_select = @mysql_select_db('test', > '$db_connect'); > > > > if (isset($_POST['submit'])) > { > if (isset($_POST['name'])) > { > $name = $_POST['name']; > } else > { > $name = FALSE; > } > > if (isset($_POST['address'])) > { > $address = $_POST['address']; > } else > { > $address = FALSE; > } > > > $file_name = $_FILES['upload']['name']; > if (isset($file_name)) > { > //echo $file_name; > //move_uploaded_file ( $file_name, './upload'); > move_uploaded_file ( $file_name, '../upload'); > > if > (is_uploaded_file($_FILES['upload']['tmp_name'])) { > echo "File ". $_FILES['upload']['name'] ." > uploaded successfully.\n"; > > } else { > echo "Possible file upload attack: "; > echo "filename '". $_FILES['upload']['tmp_name'] > . "'."; > } > > } else > { > $file_name = FALSE; > } > > > $emp_id = $_POST['emp_id']; > > if ($name && $address && $file_name) > { > $query_insert_emp = "insert into banga > values('$emp_id', '$name', '$address', > '$file_name')"; > $result_insert_emp = mysql_query($query_insert_emp); > echo "insertion complate"; > > /* > $is_result_insert_emp = > mysql_insert_id($result_insert_emp); > if ($is_result_insert_emp) > { > echo "insertion complate"; > } > */ > } > > > > > > > > } > > > > > > > $select_id = "select id from banga"; > $select_result = mysql_query(select_id); > $select_result_num = > @mysql_num_rows($select_result); > if ($select_result_num == 0) > { > $emp_id = 0; > } else > { > $emp_id = $select_result_num; > } > > > > > > ?> > > > > > > > > > > > > > > > > > > > > > > <html> > <head><title>Sukalyan</title></head> > <body bgcolor="sukalyan"> > <form enctype="multipart/form-data" > action="banga.php" method="POST"> > <input type="hidden" name="MAX_FILE_SIZE" > value="30000" /> > <fieldset><legend>Submit this form</legend> > <b>Emp_number: <?php echo $emp_id; ?></b><br> > <input name="emp_id" type="hidden" value="<?php > $emp_id; ?>"> > > > <b>Name:</b><input name="name" type="text"><br> > <b>Address:</b><input name="address" > type="text"><br> > <b>Upload Photo:</b><input name="upload" > type="file"><br> > </fieldset> > > <div align="center"><input name="submit" > type="submit" value="submit"></div> > > </form> > > > </body> > </html> > > [Non-text portions of this message have been > removed] > > > > PHP Data object relational mapping generator > http://www.metastorage.net/ > Yahoo! Groups Links > > > php-objects-unsubscribe@xxxxxxxxxxxxxxx > > > > > ___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com PHP Data object relational mapping generator http://www.metastorage.net/ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-objects/ <*> To unsubscribe from this group, send an email to: php-objects-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/