November 1st, 1999, 11:49 AM
I was wondering if anyone might know the proper mysql syntax for a problem I am hitting.
I am playing around with setting up user authentication for a site using mysql as the backend and PHP up front. I don't want to create 50-1000 new records in the user and db tables for various and sundry reasons. I'd rather have a table (fooClients) within the site specific database (fooBase) already built.
Within fooClients there is an ID and a Login (read: password) field. While it would be very easy to have the Login as a varchar (15) field I'd prefer to use the password encyption. That's where the snag hits.
Select * From fooClient Where Login = 'foo'
doesn't work, because it's not passing 'foo' to mysql in it's encrypted form.
Select * From fooClient Where Login = password('foo') doesn't fly either.
Mucho thanks in advance!
November 1st, 1999, 01:06 PM
Are you sure it was stored using the mysql password() encryption and not something else?
November 1st, 1999, 03:27 PM
Positive. I've done it both manually and via phpMyAdmin and made sure the password encryption is set on my test users.
November 2nd, 1999, 10:43 AM
OK, for some reason I thought you were using an existing table (not one you developed). Many people don't use mysql's password encryption but encode in the script using md5 for example.