//print the form echo "<script> function view_img(img_name){ document[img_name].src = upForm.imgfile.value; document[img_name].width = 150; } </script>\n\n <br><h3>:: Browse an Image to Upload:</h3>\n <form method=\"post\" name=\"upForm\" enctype=\"multipart/form-data\" action=\"$_SERVER[PHP_SELF]\">\n <input type=\"file\" name=\"imgfile\" onchange=\"javascript:view_img('img_vv');\"> <img src='' name='img_vv' width='0'><br>\n Image width will resize to <b>$img_thumb_width</b> with height ratio. <br><input type=\"Submit\" name=\"upForm\" value=\"Upload & Resize\">\n </form> <a href=\"view_gallery.php\">View Images</a>"; }
mysql_query("INSERT INTO user_images (user_id, ext) VALUES ('$id', '$file_ext')") or die (mysql_error()); ?>
but when it inserts the data into my database it also insers 2 blank data showin in the image below but why is this happening and how can i fix it in my code??