PDA

View Full Version : Compare recordset with integer



bubberz
15 Aug 2005, 12:01 PM
Here's what I have to do after a user clicks the Submit button:
1. Verify an IDNumber is valid
2. Verify a password entry is correct

I'm using mySQL as a backend, and the table has only two columns: IDNumber and video.

If 1. and 2. are correct, I update a field, video, to 1 in order to give someone credit for seeing a training video.

I've done a recordset for the first text box in order to return a 1 or 0 to validate the IDNumber, Recordset2.TotalRecords

What I don't know how to do is to take the recordset for the IDNumber, compare it with a variable for the password, and post a value to a label (lblWarning) that the user has issues the the IDNumber or password.........or to tell them they now have credit for seeing the video.

I'm trying the following for a start but getting syntax errors:
<?PHP
If (Recordset2.TotalRecords=1) {lblWarning = "This is a valid IDNumber"}
?>

DaiWelsh
16 Aug 2005, 03:39 AM
That does not look much like PHP code to me, more like asp.net or similar, but anyway, if you can show a little more of your code (the query and what you do with it, you may get a better response.

From what you have said I am not clear on several points:
- Where does the password come from if it is not in the database?
- What is lblWarning (if it is a variable it needs a $ at the front)?
- Is the IDNumber specific to the user? If so how is it set and if not then I think your table structure is flawed.

Really hard to understand what youa re trying to achieve without more info.