Hi, I am having a problem with the following code:-
It is meant to populate a select box in a form with whatever is returned from the query. For some reason it does it, but always misses out the first entry from the database. It does retrieve all values as i can print them all, but as soon as I want them in a select box the first value is missed out. Anybody any ideas?
Im not sure of the source of this problem so i apologise if it isnt classed as a php problem :-)
PHP Code:
$skills_query = "SELECT skill_id, skill_name FROM skills";
$skills_result = mysql_query($skills_query);
$num_rows_skills = mysql_num_rows($skills_result);
print $num_rows_skills;
print "<tr><td> Skills </td><td><select name='skillID[]' size='5' multiple";
while ($skills=mysql_fetch_array($skills_result)){
$skill=$skills["skill_name"];
print "<option value='$skill'>";
print $skill;
print "</option>";
}
print "</select></td></tr>";
Im not sure of the source of this problem so i apologise if it isnt classed as a php problem :-)
Comment