View Single Post
  #6 (permalink)  
Old 05-23-08, 10:13 PM
drewby drewby is offline
Newbie Coder
 
Join Date: May 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
$query = "SELECT id FROM users WHERE username = '".$username."' AND password = '".$password."'";
						
$result = mysql_query($query) or die(mysql_error());
						
list($user_id) = mysql_fetch_row($result);
Is this what you were suggesting?

I echoed the $result and still got Resource Id #4

Also, with echoing $user_id....nothing echoes so it's empty and that is why the it returns the 'Invalid login'?

(Also, the database is called cms with a table called users consisting of four fields (id, username, password, and email) )

Last edited by drewby; 05-23-08 at 10:16 PM.
Reply With Quote