I have a parent table and a child table linked with an Id. The child table has two fields - ch_id and item. The parent table has a field which stores the value of ch_id for that row. I have set up a php script to generate a selection list in an html page.
The selection list only displays the text values of 'item'. Following a Submit the $_POST value will contain the text of the selected item. However, I want to store the ch_id value corresponding.
A couple of ways that I can see, that I do not like, are - display the ch_id and the item text in the selection list and strip the id out before storing. This looks messy on the form; or do a reverse mySQL selection before updating the parent table.
Is there a smarter way to achieve this? In MS Access the list box can contain both fields with the id not displaying but being linked to the parent field.