Can't find the error..

A

Anonymous

Guest
Can anyone see the error on line 3 of this piece of code?

$rankquery = "select rank, max(rank) from info";
$rankresult = mysql_query($rankquery);
$rank = mysql_fetch_row($rankresult);

Here's the error message:

Warning: Supplied argument is not a valid MySQL result resource in /home/www/et/register.php on line 66
 
you're selecting the field "rank" and "max(rank)" at the same time.
the max function has to be called alone (no other fields) or with group by.

Could also be possible that you're table doesn't exist or the field rank doesn't exist (typo?)

Greetz daan
 
Thanks DoppyNL. Removed the 1st "rank" in the query and it worked fine.
 
Back
Top