$result = mysql_query("SELECT * FROM personnel",$db) ;
Your syntax is incorrect, thus the result ID is returning negative, or no results (ERROR).
Your query would be correct if you were using something like the following which has been deprecated.
$result = mysql_db_query($db,"SELECT * FROM personnel") ;
The Correct syntax for the query you are trying to make would be..
$result = mysql_query("SELECT * FROM personnel");
if(mysql_num_rows($result) == "0")
{
die(mysql_error());
}
OR
$result = mysql_query("SELECT * FROM personnel") or die(mysql_error());
Cheers.