Howto use ENCRYPT() function of MySQL

I think you have to create a custom query:

INSERT INTO t VALUES (1,AES_ENCRYPT('text','password'));

try and let me know

Ajit

And you've opened yourself wide open to SQL injection attacks.

Much safer (untested):

sql = %(SELECT ENCRYPT(:password)) User.find_by_sql([sql, {:password => pass}])

Michael Glaesemann grzm seespotcode net