Hi,
I'm trying to check to see if a username/password combination exists in a mysql database. For example, I have the person's username that he/she typed in in the variable $username. I have their password (I haven't coded the encryption part yet, but that's beside the point) in the variable $password.
When I query the database and ask it if the username=$username AND password=$password, it will bring back any field in the database that has any "pattern match" of the $username. So, for example, if in the database I had my name and a password:
username: dave
password: password
and somebody came by and typed in "da" for the $username and "pass" for the password, it lets 'em go on by because it finds the match.
My initial thought was to create a regular expression that would check to see if the field "username" in the database Begins and Ends with the pattern $username.. but it didn't work. Any ideas on how I do this?