Hey I'm wanting to retrieve some data from the a database. But it seems no matter what values I enter into my SQL database I always return with "Password is incorrect" statement embedded in my code. (It's down the better for reference and returns 1). Can anybody see anything wrong with my code where $pw will always return 1?
3
-
1Why don't you print or echo the values from variables $pw and $password to see if matches? to me it seems like their values are distinct...ericpap– ericpap2014-10-05 15:37:02 +00:00Commented Oct 5, 2014 at 15:37
-
I would print their values in the line where you echo "Password Incorrect."ericpap– ericpap2014-10-05 15:38:03 +00:00Commented Oct 5, 2014 at 15:38
-
Sorry what do you mean by "print their values"? As doesn't return 1 mean that the password that has been entered is incorrect? and therefore not correct? If I print there value in return 1 it doesn't make the answer anymore correct? Sorry that's just from my understanding.user2857301– user28573012014-10-05 15:40:25 +00:00Commented Oct 5, 2014 at 15:40
Add a comment
|
2 Answers
Try changing $pw so it takes the correct password from the database as in:
$pw = OCIResult($stmt,"PASSWORD");
instead of trying to get the value of the column 1 as in your example since i believe you are returning something else (propably the username following your other questions) by referencing column 1.
1 Comment
user2857301
Hmm it still seems to be giving me "Password is incorrect". Instead of "You have been logged in!" when a correct PW and username is used. Ill keep looking.