rockindano30 Posted May 15, 2008 Share Posted May 15, 2008 Hello all i'm having a little difficulties with this sql syntax. SELECT * FROM users WHERE Uname='user1' and Pword='user1'; with the above sql syntax it returns 0 records and with SELECT * FROM users WHERE Uname='user1'; it returns one record. now i have two records in this database but having this problem. please help. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted May 15, 2008 Share Posted May 15, 2008 is there any record in the database where Uname='user1' and Pword='user1'? Quote Link to comment Share on other sites More sharing options...
rockindano30 Posted May 15, 2008 Author Share Posted May 15, 2008 yes, there are two records that im using for testing. it does display it the record with select * from users where Uname='user1'; but not with select * from users where Uname='user1' and Pword='user1'; Quote Link to comment Share on other sites More sharing options...
rockindano30 Posted May 15, 2008 Author Share Posted May 15, 2008 or it doesn't even display any records also if i use select * from users where Pword='user1'; im using MD5() to encrypt the Pword when its being add into db Quote Link to comment Share on other sites More sharing options...
rockindano30 Posted May 15, 2008 Author Share Posted May 15, 2008 why won't this give me or show me my records? SELECT * FROM users WHERE Uname='{$Uname}' AND Pword='{$Pword}'; Quote Link to comment Share on other sites More sharing options...
rockindano30 Posted May 15, 2008 Author Share Posted May 15, 2008 no help? Quote Link to comment Share on other sites More sharing options...
revraz Posted May 15, 2008 Share Posted May 15, 2008 You know, making another post about the same topic doesn't help, it actually makes it worse. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted May 15, 2008 Share Posted May 15, 2008 You need to check the MD5 of the entered password with the MD5 in the database. So, run MD5() on the incoming password and use that in the SQL. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.