I am receiving a very strange error when running a while loop to pull out rows from a mySQL db using PHP....

Warning: Supplied argument is not a valid MySQL result resource in /home/tribaloutpost/public_html/teamwa/tribescon/roster.php3 on line 40

Line 40 is the beginning of the while loop which looks like...

while($myrow = mysql_fetch_array($result)) {
$list[$myrow['id']] = $myrow["$sortby"];

Any ideas? I am in deperate need. Thanks