email address


key_three

retrieve your username and password

With an SQL statement, do the following. Match your (singular) email address, with an (plural) existing email address.

If the given email matches with an existing email then do "SELECT ALL COLUMNS" and WHERE a match is found.

To detect if a match was made use a mySQL function called "count rows". The function is set to a variable. The function retrives the result, which is set to a variable.

Finally, we run an IF statement on the result. If the variable contains nothing, then we terminate the script. Prior to the terminatation, we set a session variable with the message "error", and then return the player back to the login screen.

If the variable contains only one row, then we have met the conditions required to proceed. We set up a session variable, and store the username and password to variables. Think of this like putting two pieces of information in an envelop and sending it off to the users email account.