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 GROUP BY `cats`.`id` ORDER BY `lft`' at line 4

SELECT `cats`.*, COUNT(pages.cid) as numpages FROM `cats` LEFT OUTER JOIN `pages` ON `pages`.`cid` = `cats`.`id` WHERE lft BETWEEN AND GROUP BY `cats`.`id` ORDER BY `lft`

Filename: models/Mcats.php

Line Number: 89