You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Worker AND grade = '' AND type = '0' AND loc = Unknown Location ORDER BY edited ' at line 1