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 = 17745 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=17745
Date         : Mon, February 27, 2017 21:04:23
IP           :
Browser      : CCBot/2.0 (http://commoncrawl.org/faq/)
Referer      : 
PHP Version  : 5.6.29-0+deb8u1
OS           : Linux
Server       : Apache/2.4
Server Name  : www.missionsite.net