I want to display a table with mysql and ajax with a selected tag in one of its cells, and here's the question (I already have it) How do I get the value shown in the dropdown to be the one in the database?
I consider that I don't need to copy the code.
First, thank you. I'll try to explain myself: I have a table output from mysql using php. A field called 'status' is one
<select>
that I want when the table is displayed, the first option, the one with the attribute,selected
is precisely the one that appears in the database. Eg: If in the query it appears that the status with id=1 is 'lost', I want that word to be the one with the attributeselected
. I've done this:It finally works. I hope that this code will serve as a contribution to the forum and help whoever needs it ;).