error 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 'connell' AND is_approved = '1' AND rating>'0'' at line 1 with query SELECT AVG(rating) from page_comments WHERE page_id='o_jerry-o'connell' AND is_approved = '1' AND rating>'0'