Scott Haneda <[EMAIL PROTECTED]> wrote:
> Here is what I am doing now...
>
> SELECT id, first_name, last_name, password FROM account WHERE password =
> ENCODE("1234", 'foobar') ORDER BY last_name LIMIT 0,10
>
> I need to do a where password LIKE '%1234%' instead, I can not seem to get
> this to work, is there some trick?
There is DECODE() function in MySQL. You can perform pattern-matching search for the
decrypted password:
SELECT .. FROM account WHERE DECODE(password, 'foobar') LIKE '%1234%' ORDER BY
last_name LIMIT 0,10;
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]