Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by chson » Thu Oct 31, 2002 9:05 pm
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
-
chson
- New php-forum User

-
- Posts: 8
- Joined: Mon Oct 14, 2002 5:57 pm
by DoppyNL » Fri Nov 01, 2002 12:23 am
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
-
DoppyNL
-
by chson » Fri Nov 01, 2002 3:11 pm
Thanks DoppyNL. Removed the 1st "rank" in the query and it worked fine.
-
chson
- New php-forum User

-
- Posts: 8
- Joined: Mon Oct 14, 2002 5:57 pm
Return to PHP coding => General
Who is online
Users browsing this forum: No registered users and 8 guests