RE: [PHP-DB] Selecting PASSWORD() value in MySQL
| From: | John W. Holmes | Date: | Thu, 10 Oct 2002 23:16:40 +0000 |
| Subject: | RE: [PHP-DB] Selecting PASSWORD() value in MySQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22330@lists.php.net to get a copy of this message | ||
> I'm trying to retrieve data from a MySQL table which contains data
> encrypted with the MySQL "PASSWORD()" function from a PHP script but I
> can't seem to get it to work. Below is the query I'm trying:
>
> SELECT * FROM user_data WHERE username = 'thaak' AND password =
> PASSWORD('thaak');
>
> I then tried the following subquery/subselect:
>
> SELECT * FROM user_data WHERE username = 'thaak' AND password IN
(SELECT
> PASSWORD('thaak') FROM user_data);
>
> ...which also didn't work.
How do you know it "didn't work"? The first query is what you want to
use. If you are using PHP variables, make sure they actually have the
values you expect in them.
---John Holmes...