Trying to fix sql syntax error