Posts: 112
Threads: 18
Joined: Dec 2012
Can someone tell me how to fix this?
PHP код:
mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\website\index.php on line 28
this is line 28:
PHP код:
$check = mysql_num_rows($u_check);
Posts: 2,286
Threads: 18
Joined: Jun 2010
Most likely the query failed so the result was "false"
Posts: 112
Threads: 18
Joined: Dec 2012
Quote:
Originally Posted by LuiisRubio
PHP код:
$check = is_resource($u_check) ? mysql_num_rows($u_check) : 0;
|
Thank you so much!
Posts: 112
Threads: 18
Joined: Dec 2012
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?
Posts: 278
Threads: 44
Joined: Aug 2012
Reputation:
0
put the output of the script in an echo
echo "[here output]"
Posts: 112
Threads: 18
Joined: Dec 2012
I'm new to PHP and CSS and I don't know what you mean.
Posts: 112
Threads: 18
Joined: Dec 2012
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");
}
Posts: 112
Threads: 18
Joined: Dec 2012
Quote:
Originally Posted by park4bmx
try
PHP код:
header("location: so on..
exit();
so it does keep on performing it
|
Nope.