question of select data from database to be a opition
firstly , under the ajax method, i have this and it is available and working
xmlhttp.open("GET","code_add_test2.php?q="+str,true);
<form>
<select name="users" onchange="showUser(this.value)">
<option value="">Select a person:</option>
<option value="30">viki</option>
<option value="25">simon</option>
<option value="24">Paul</option>
<option value="28">Angie</option>
<option value="46">ANNIE</option>
</select>
</form>
however i want to select the row in my database to become the option
and i have this , how to combine these two into one??? thank you
<select name="ch_staff" id="ch_staff">
<?php
require_once('Connections/XXXXXXX.php');
mysql_select_db('staff');
$query="select staffid From staffdata";
$result=mysql_query($query);
$num_result=mysql_num_rows($result);
for($i=0;$i<$num_result; $i++)
{
$row=mysql_fetch_array($result);
$now = htmlspecialchars(stripslashes($row['staffid']));
echo "<option value='$now'>$now</option>\n";
}
?>
</select>
