Thread: Admin Login?
View Single Post
Old 05-24-2009, 02:50 PM   #2 (permalink)
allworknoplay
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

You could try putting the MD5 within the query itself, I don't know if that will help. It might be worth a try. If you do try that, make sure you comment out the line earlier where you use MD5 on the password variable.
PHP Code:
$sql "SELECT username FROM user WHERE username = '$user' AND password = MD5($pass)"
Also, you don't have to make 2 calls to the DB when checking a user's existence and their user_id.

In your original query, just add the user ID column to your SELECT statement. That way, when it is valid you can just get the ID. You don't need that WHILE loop in there...
allworknoplay is offline  
Reply With Quote