0

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
  • 1
    Why 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... Commented Oct 5, 2014 at 15:37
  • I would print their values in the line where you echo "Password Incorrect." Commented 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. Commented Oct 5, 2014 at 15:40

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.
0

Try change this line:

echo "Password is incorrect. \n";

for this:

echo "Password is incorrect.".$pw.";".$password;

And comment the result

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.