Changed SQL queries to use placeholders insead of the Perl DBI quote
TODO: Check if manual escaping breaks queries that are using placeholders