MySQL error?
#1

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); 
Reply
#2

Most likely the query failed so the result was "false"
Reply
#3

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

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

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?
Reply
#6

put the output of the script in an echo

echo "[here output]"
Reply
#7

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

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");

Reply
#9

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

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


Forum Jump:


Users browsing this thread: 3 Guest(s)