Stop mysql syntax error exceptions