A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: controllers/view.php

Line Number: 567

Database Error

A Database Error Occurred

Error Number: 1064

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 'AND source='ap' GROUP BY headline ORDER BY priority DESC, updated DESC LIMIT 5' at line 1

SELECT t1.ManagementID, t1.title, t1.priority, t1.published, t1.updated, t1.headline, t1.pics_num, t1.vids_num, t2.* FROM stories as t1 INNER JOIN story_cats as t2 ON t1.ManagementID = t2.ManagementID WHERE category= AND source='ap' GROUP BY headline ORDER BY priority DESC, updated DESC LIMIT 5