Modification of SQL queries

Modified SQL queries to protect against injection