[eluser]JuanitoDelCielo[/eluser]
Hi there guys. I was working in a CRUD but I have problems with the set_select function
I get the information from the database and I tried to use this code to set the value from the database to the select among the other options.
This is my code where $user->city it's the value from the database and it's a numeric value.
Code:
$user->city = 1;
<select name="city">
<option value="0" <?php set_select('city', $user->city)?>>A</option>
<option value="1" <?php set_select('city', $user->city)?>>B</option>
<option value="2" <?php set_select('city', $user->city)?>>C</option>
</select>
Acording to my logic if $user->city its equal to 1 the secound option shoul get the selected atribute but it doesn't what I'm doing wrong?