Dynadot โ€” .com Registration $8.99

Please explain to me..

Spaceship Spaceship
Watch

SiKing

Registered MemberEstablished Member
Impact
6
Hi. Please explain to me why the hell PHP is ignoring 'AND password='$password'' in the following:

PHP:
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
$id=mysql_result($query,0,"id");

When signing into my site, I can log in with ANY password. I have looked at my database and the password is set at ONE password.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hmm, not sure, but try this instead.

PHP:
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); 
$id = mysql_query($query,0,"id");
 
0
•••
Didn't work. It must be something to do with the password check
 
0
•••
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back