Search
Left Quote    By failing to prepare, you are preparing to fail.
- Benjamin Franklin    
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   
Unregistered
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.

    Viewed: 2,430 Times | Reply to This | To top
Viewing Page: 1 of 1



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








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank