ENCODE(str,pass_str) (Encrypt str using pass_str as the password.) : ENCODE « Encryption Compression Functions « MySQL Tutorial






To decrypt the result, use DECODE().

mysql>
mysql> select decode(encode("text","password"),"password");
+----------------------------------------------+
| decode(encode("text","password"),"password") |
+----------------------------------------------+
| text                                         |
+----------------------------------------------+
1 row in set (0.00 sec)

mysql>
mysql>








19.9.ENCODE
19.9.1.ENCODE(str,pass_str) (Encrypt str using pass_str as the password.)