UltraFlux
asked on
SELECT help with php and mysql
I have various select drop-down boxes which display dob, position, experience, etc
1. The user fills out the form and data is stored in mysql
2. The user edits the form all of my SELECT boxes are set to default.
How can I display the data from the table as default? And also update the table if the SELECT changes?
1. The user fills out the form and data is stored in mysql
2. The user edits the form all of my SELECT boxes are set to default.
How can I display the data from the table as default? And also update the table if the SELECT changes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I already use a dynamic list ^^
<option value="1" <?php echo (($row['position']==1? ' selected ': '')) ?>>CEO</option>
<option value="2" <?php echo (($row['position']==2? ' selected ': '')) ?>>Manager</option>
This is what does it right?
Whichever item is in the DB will show selected and the rest wont.
dr_dedo I'm posting another question similar to this I just dont want to ask another question in here.
<option value="1" <?php echo (($row['position']==1? ' selected ': '')) ?>>CEO</option>
<option value="2" <?php echo (($row['position']==2? ' selected ': '')) ?>>Manager</option>
This is what does it right?
Whichever item is in the DB will show selected and the rest wont.
dr_dedo I'm posting another question similar to this I just dont want to ask another question in here.
<select name="something">
<option value="value1">Value1</opt
<option value="value2" selected>Value2</option>
<option value="value3">Value3</opt
</select>