Answer the question
In order to leave comments, you need to log in
How to default select another option in select?
Hello. Can you please tell me how to choose for select by default the option whose id is passed from the database?
i.e. there is a code
$old = mysql_fetch_array(mysql_query("SELECT title, cost, fr, btext, img, category FROM service WHERE id='".$iidd."'"));
<select name="category" value="<?php echo $old[5]; ?>">
<option value="1">Популярные</option>
<option value="2">YouTube</option>
<option value="3">Вконтакте</option>
<option value="4">Twitter</option>
<option value="5">Instagram</option>
<option value="6">Facebook</option>
<option value="7">Одноклассники</option>
<option value="8">Google+</option>
<option value="9">Periscope</option>
<option value="10">Другие услуги</option>
</select>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question