SA-MP Forums Archive
MySQL error? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: MySQL error? (/showthread.php?tid=405485)



MySQL error? - Jernu - 06.01.2013

Can someone tell me how to fix this?

PHP код:
mysql_num_rows() expects parameter 1 to be resourceboolean given in C:\xampp\htdocs\website\index.php on line 28 
this is line 28:
PHP код:
$check mysql_num_rows($u_check); 



Re: MySQL error? - KingHual - 06.01.2013

Most likely the query failed so the result was "false"


Respuesta: MySQL error? - hotspicytaco - 06.01.2013

PHP код:
$check  is_resource($u_check) ? mysql_num_rows($u_check) : 0



Re: Respuesta: MySQL error? - Jernu - 06.01.2013

Quote:
Originally Posted by LuiisRubio
Посмотреть сообщение
PHP код:
$check  is_resource($u_check) ? mysql_num_rows($u_check) : 0
Thank you so much!


Re: MySQL error? - Jernu - 07.01.2013

Okay, I get too many redirect loops



How could I sort this?

Someone replied:
"If you get a redirect loop and you don't know how to fix it, just change the php header redirect to a normal html one using "echo"."
However, I don't get what he means?


Re: MySQL error? - Mado - 07.01.2013

put the output of the script in an echo

echo "[here output]"


Re: MySQL error? - Jernu - 07.01.2013

I'm new to PHP and CSS and I don't know what you mean.


Re: MySQL error? - Jernu - 07.01.2013

Does anyone know?!

EDIT:

This is what's causing it.
PHP код:
session_start();
$user $_SESSION["user_login"];
if (!isset(
$_SESSION["user_login"])) {
    
header("location: index.php");
    exit();
}
else
{
header("location: home.php");




Re: MySQL error? - park4bmx - 07.01.2013

try
PHP код:
header("location: so on..
exit(); 
so it does keep on performing it


Re: MySQL error? - Jernu - 07.01.2013

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
try
PHP код:
header("location: so on..
exit(); 
so it does keep on performing it
Nope.