php - Save value as other table value -
I have an HTML form that saves all entered values in SQL database, one of the options drawn by the database Dropdown menu is there. I want a way to save the population option because this is the user ID number instead of a readable name. There is another column in the ID number entry
is currently using it to populate the dropdown:
$ sql = "select site by name"; $ Result = mysql_query ($ sql); Echo "& lt; select name = 'venuename' & gt;"; While ($ line = mysql_fetch_array ($ result)) {resonant "& lt; option value = '" $ line [' name '] "' & gt;" . $ Line ['name'] "& lt; / option & gt;"; } Resonate "& lt; / select & gt;"; Get the id
ID value attribute. $ sql = "SELECT id, name by name"; $ Result = mysql_query ($ sql); Echo "& lt; select name = 'venuename' & gt;"; While ($ line = mysql_fetch_assoc ($ result)) {echo "lt; option value = '". $ Line ['id'] "'' Gt;" . $ Line ['name'] "& lt; / option & gt;"; } Resonate "& lt; / select & gt;";
Comments
Post a Comment