lilwing Posted August 20, 2007 Share Posted August 20, 2007 hey guys, i need to know an easy secure way to echo all the values in a column (like by the primary key or something) to a form list/menu, so the user can select and update. i also need to know how to echo the current data in the selected row to a field in a form so it can be easily edited. Link to comment https://forums.phpfreaks.com/topic/65828-updating-mysql-with-form/ Share on other sites More sharing options...
lilwing Posted August 20, 2007 Author Share Posted August 20, 2007 bump. here's what i have now, it echoes my failure message next to my form menu... not sure what the problem is. <?php $Host= "bleep"; $User= "bleep"; $Password= "bleep"; $TableName= "bleep"; $Link = mysql_connect ($Host, $User, $Password); $Query = "Select updated_on from $TableName"; $results = mysql_db_query($DBName, $Query, $Link); ?> Which Entry would you like to edit? <select name = "drop1" size="1"> <Option Value=" ">Select One:</option> <?php for($u=0;$u<mysql_num_rows($results); $u++) { $ID=mysql_result($results,$u,'updated_on'); ?> <option value="<?php echo($ID); ?>"><?php echo($ID); ?></option> <?php } ?> </select> <?php if (mysql_db_query ($DBName, $Query, $Link)) { print ("link was SUCCESSFUL<BR>\n"); } else { print ("FAILURE<BR>\n"); } mysql_close ($Link); ?>[ /code] Link to comment https://forums.phpfreaks.com/topic/65828-updating-mysql-with-form/#findComment-328980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.