When I load this page I get the error:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in report.php on line 130 (the line that reads $result= mysql_query($sql,$o_conn)
I know the query is valid and my datbase connection is correct, so there must be something wrong with the function. What could be wrong?
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in report.php on line 130 (the line that reads $result= mysql_query($sql,$o_conn)
I know the query is valid and my datbase connection is correct, so there must be something wrong with the function. What could be wrong?
Code:
function display_assigners($parent, $level)
{
$sql="SELECT FirstName, LastName, ID FROM teacher WHERE ParentAdminID=".$adderid;
$result= mysql_query($sql,$o_conn);
if(mysql_num_rows($result)==0)
{
print str_repeat(' ',$level)." -- none.<BR>";
}
else
while ($row = mysql_fetch_array($result))
{
print str_repeat(' ',$level).$row['FirstName']." ".$row["LastName"]."<BR>";
display_assigners($row['ID'], $level+1);
}
}