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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -