Error

An error has occurred.

Error message:
Mysqli prepare 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 'AND e.type = 2 ORDER BY e.id' at line 1

Error trace:
#0 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('SELECT e.id, e....') #1 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'SELECT e.id, e....') #2 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('SELECT e.id, e....') #3 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Db/Adapter/Abstract.php(734): Zend_Db_Adapter_Abstract->query('SELECT e.id, e....', Array) #4 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/multiformo/application/modules/projects/models/ProjectsModel.php(383): Zend_Db_Adapter_Abstract->fetchAll('SELECT e.id, e....') #5 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/serdarsahin.com/application/controllers/ProjectController.php(38): ProjectsModel::getImages(NULL, 2) #6 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Controller/Action.php(513): ProjectController->indexAction() #7 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('indexAction') #8 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #9 /mnt/web107/d1/75/52446375/htdocs/serdarsahin.com/serdarsahin.com/public/index.php(44): Zend_Controller_Front->dispatch() #10 {main}