I kept getting
an error
(Warning:
mysql_num_rows(
): supplied
argument is not
a valid MySQL
result resource
in /header.php
on line 55)
when using
cookies to log
back in after
an expired
session using
this code:
(header.php)
Code:
$qu =
mysql_query(&qu
ot;SELECT
'user_password'
FROM 'users'
WHERE
'username' =
'$user'"
Discovered that
this was
causing an sql
error (#1064 -
You have an
error in your
SQL syntax.)
This syntax
fixed the
problem:
Code:
$qu =
mysql_query(&qu
ot;SELECT
user_password
FROM users
WHERE
username='$user
'"  ;
Note: My fields
may now be
different to
the tutorial's,
so copy the
syntax and
don't copy and
paste this
code, if you
have this
problem.
|