Added real_escape_string to all SQL queries.