Hi guys,
Very basic problem but I'm kind of new to all this.
I need to get a single piece of data out of a table in MySQL - a user's password. Here's the tyable:
Table: USERS
USER_ID | USER_NAME | USER_PASS
1 | Skunk | pass1
2 | Mut | pass2
etc
I've got a form which sends in a USER_ID and an entered password. I need to check that password against the one in the database before allowing them to proceed.
Problem is - as far as I can tell all the MySQL PHP commands result in arrays etc. I don't want an array, I want a single variable with the password form the database for that user in it.
Here's what I've got in the way of SQL:
$sql = "SELECT USER_ID, USER_PASS FROM USERS WHERE USER_ID=\"$data_from_form\"";
I've got all the connection stuff etc - the question is, how do I get my variable $db_user_password to equal whatever the USER_PASS for that user ID is?
This is only my third attempt at a PHP application so cut me some slack ;o)
Cheers,
Skunk