tgribble Posted May 13, 2011 Share Posted May 13, 2011 hello this form is not submitting all the 'jeweltype' data to the mysql db. help please ============================================= html> <head> <title>Upload an image to a database</title> </head> <body> <table> <form name="Picture" enctype="multipart/form-data" method="post"> <tr> <td>Upload <input type="file" name="imagefile"><br /> Jewelery Type: <select> <?php $sql="SELECT jeweltype FROM jeweltypes"; $result =mysql_query($sql); while ($data=mysql_fetch_assoc($result)) { ?> <option value="jeweltype"><?php echo $data['jeweltype'] ?></option> <?php } ?> </select> <br /> <input type="submit" name="xsubmit" value="Upload"> </td> </tr> <tr> <td>Latest Image</td> </tr> <tr> <td><img src="?pic=1"></td> </tr> </form> </table> </body> </html> ========================================== with this query ========================================== <html> <head><title>Your Page Title</title></head> <body> <?php include ('connect.php'); @mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query( "SELECT jeweltype FROM jewel_images" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; print "<table width=400 border=1>\n"; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; foreach ($get_info as $field) print "\t<td><font face=arial size=1/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/236283-form-submission-missing-data/ Share on other sites More sharing options...
phppaper Posted May 13, 2011 Share Posted May 13, 2011 { ?> <option value="jeweltype"><?php echo $data['jeweltype'] ?></option> <?php } Should be { ?> <option value="<?php echo $data['jeweltype'] ?>"><?php echo $data['jeweltype'] ?></option> <?php } Link to comment https://forums.phpfreaks.com/topic/236283-form-submission-missing-data/#findComment-1214808 Share on other sites More sharing options...
tgribble Posted May 13, 2011 Author Share Posted May 13, 2011 just tried that but no success? Link to comment https://forums.phpfreaks.com/topic/236283-form-submission-missing-data/#findComment-1214810 Share on other sites More sharing options...
wigwambam Posted May 13, 2011 Share Posted May 13, 2011 <select> Should be <select name="jeweltype"> Link to comment https://forums.phpfreaks.com/topic/236283-form-submission-missing-data/#findComment-1214917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.