Fixed TEXT encapsulation in SQL queries.

Tested with actual entries inserted into the DB.