Left Quote    Maybe this world is another planet's Hell.
- Aldous Huxley    
Right Quote
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply

        Viewing Topic: CMS: one cookie login problem resloved?
  This user is online  Guest
  Subject: "CMS: one cookie login problem reslo..." Posted: @ 8:29 am on Dec 02 2005   
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:


$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:

$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.

    Viewed: 3,273 Times | Reply to This | To top
Viewing Page: 1 of 1

You must be logged in to post on the forums. Login or Register

"" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy