Some times you need to store encrypted data in the data base, specially for the case of user passwords.
Writing code to retrieve in programming language can be tedious. Mysql functions provide a great deal here.
You can easily encrypt fields when inserting in MySql
For retrieval you can use