I have a PHP/mySQL database running, and I've realized I'm come across an awkward little bug.
I have a form where a user fills out their information using populated drop down boxes. This information gets stored in the database. Then, if a user wants to edit their information later, they can go to the Edit Details page which calls up a page almost identical to the original form when they first set themselves up. Of course, the person's information is pulled from the database, and is echoed as the values of the form elements.
My issue is that the drop down boxes do not echo the value They are updated in the database correctly, but the drop downs don't know how to select the appropriate values.
The <select> tag doesn't support a value option, and I can't hardcode the selected="selec ted" into any specific <option> tag because the input from the database needs to determine which one that is.
Any suggestions anyone has would be greatly appreciated. Thanks!
I have a form where a user fills out their information using populated drop down boxes. This information gets stored in the database. Then, if a user wants to edit their information later, they can go to the Edit Details page which calls up a page almost identical to the original form when they first set themselves up. Of course, the person's information is pulled from the database, and is echoed as the values of the form elements.
My issue is that the drop down boxes do not echo the value They are updated in the database correctly, but the drop downs don't know how to select the appropriate values.
The <select> tag doesn't support a value option, and I can't hardcode the selected="selec ted" into any specific <option> tag because the input from the database needs to determine which one that is.
Any suggestions anyone has would be greatly appreciated. Thanks!
Comment