Query Error

MySQL Error  : Query Error
Query        : SELECT x.*, COUNT(z.com_id) as comments FROM book_data x LEFT JOIN book_com z ON (x.id=z.id) WHERE x.accepted='1' AND x.id = 22711 AND x.missionaryid =  GROUP BY x.id ORDER BY x.id DESC LIMIT 0, 1
Error Number : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GROUP BY x.id ORDER BY x.id DESC LIMIT 0, 1' at line 1
Requested URI: http://www.missionsite.net/scripts/lazarusgb/index.php?permalink=true&entry=22711
Date         : Wed, May 25, 2016 19:38:35
IP           :
Browser      : CCBot/2.0 (http://commoncrawl.org/faq/)
Referer      : 
PHP Version  : 5.6.19-0+deb8u1
OS           : Linux
Server       : Apache/2.4
Server Name  : www.missionsite.net