There is a form in which there are select elements, in each of which there are 2 selection points: on , off . I choose the items I need and send it all to the database.
But I also need to be able to edit this data. That is, open the edit form and pull data there from the database.
There are no problems with ordinary input . But with select , I got a snag. The problem is that when editing I cannot offer the same 2 options, that is, one - selected by adding (by default), and the other opposite to it.
I suspect that this is done with the help of the condition, but I cannot understand how exactly.
Started like this:
<? if ($select_pay) echo "<option selected>$select_pay</option>"; ?> How to display another option that was not selected when adding? The $ select_pay stores the selected option when adding, which I pulled out of the database.
The select itself looks like this:
<select size=1 name=pay> <option value="Включен">Включен</option> <option value="Выключен">Выключен</option> </select> 
