SA-MP Forums Archive
UCP Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: UCP Help! (/showthread.php?tid=605038)



UCP Help! - LifeRah - 13.04.2016

Guys, i am getting this error in My UCP:-
PHP код:
PHP Error Message
Warning
mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a8580654/public_html/ucp/index.php on line 60 
PHP код:
((LINE 60 Code:-))  if(mysql_num_rows($result) > 0
Second error:-
PHP код:
PHP Error Message
Warning
mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a8580654/public_html/ucp/ucp.php on line 31 
PHP код:
((LINE 31 Code:-)) if(mysql_num_rows($result) > 29
Third Error:-
PHP код:
PHP Error Message
Warning
mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a8580654/public_html/ucp/ucp.php on line 44 
PHP код:
((LINE 44 Code:-)) $wa mysql_num_rows($result); 
Kindly someone tell me how to fix these!


Re: UCP Help! - LifeRah - 14.04.2016

Can someone plz tell me how to fix these!?


Re: UCP Help! - perfectboy - 19.04.2016

This could happen, when mysql_query returns false, if it fails for some reason. So you can try this.

It happened with me long ago , you can use similar code to debug it.

Код:
$result = mysql_query($sql);
if ($result === false) {
    // error handling
    return false;
}



Re: UCP Help! - perfectboy - 19.04.2016

Can u please post in the mysql query in each case the error comes so we can assist you better it is a known error when the mysql_query returns false value.


Re: UCP Help! - JaydenJason - 22.04.2016

Could you supply us with more code? What's the query you're trying to execute?

You can find out what error was thrown by mysql_query() by using the mysql_error() function. It will tell you what the problem is with the query. (you could easily have mis-spelled a field name, or got a field in the wrong table prefix, etc; you'd need to see the error response to know for sure what the problem is)

Use
Код:
$result = mysql_query($result) or die(mysql_error());
What does this show?