Fixing a statement that caused MySQL syntax error.