Please explain to me..

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
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
•••
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Parking: a plain list of your portfolio domains
Your public portfolio page has a new option in the menu next to the sort options. "Domain list" opens a plain page with one domain name...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back