Hi everybody!
I have a script that edits some information from mysql in a form .to then update or delete it.
One of the text fields is a <select> (loaded dynamically) and I want to focus on a specific value of the list.
I know theres a way to achieve it with javascript, but maybe you can tell me a better way with php.
I show you the code:
<select name="id_instrum_edit" class="caja_admin">
<option value="nada">Select if necessary</option>
<?php
$db=mysql_connect($server,$login,$pass);
mysql_select_db($bbdd,$db);
$sql_cat= "SELECT * from ".$table4." ORDER BY 'id_sampler'";
$result_cat=mysql_query($sql_cat);
while($row=mysql_fetch_array($result_cat)){
echo"<option value='".$row["id_sampler"]."'>".$row["nombre"]."</option>";
}
echo"</select><p>";
Thank you!
🙂