emjez15
12-14-2010, 02:25 PM
Is there an easy way to select a field from a combox(select field) from MYSQL using PHP?
It can be in Ajax.
Coz' i want to create an edit form, so when it loads, it selects the current index from my sql database.
My current idea is to create a variable for each index for example:
<select>
<option <?php echo $select1; ?> value = 1>Choice 1</option>
<option <?php echo $select2; ?> value = 2>Choice 2</option>
<option <?php echo $select3; ?> value = 3>Choice 3</option>
</select>
But what if I looped the <select> for date purposes.
It can be in Ajax.
Coz' i want to create an edit form, so when it loads, it selects the current index from my sql database.
My current idea is to create a variable for each index for example:
<select>
<option <?php echo $select1; ?> value = 1>Choice 1</option>
<option <?php echo $select2; ?> value = 2>Choice 2</option>
<option <?php echo $select3; ?> value = 3>Choice 3</option>
</select>
But what if I looped the <select> for date purposes.