Fixes a syntax error

The single quotes have to be escaped there to be interpreted by PGSQL, not PHP