SQLSTATE[42000]: Syntax error or access violation: 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 '' at line 1

#0 /home/www/client/www/CPT009/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/www/client/www/CPT009/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/www/client/www/CPT009/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/www/client/www/CPT009/lib/Zend/Db/Adapter/Pdo/Abstract.php(244): Zend_Db_Adapter_Abstract->query('select count(*)...', Array)
#4 /home/www/client/www/CPT009/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('select count(*)...', Array)
#5 /home/www/client/www/CPT009/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('select count(*)...', Array)
#6 /home/www/client/www/CPT009/app/code/local/Poly/PolycatalogSearch/Model/Advanced.php(222): Zend_Db_Adapter_Abstract->fetchAll('select count(*)...')
#7 /home/www/client/www/CPT009/app/code/local/Poly/PolycatalogSearch/controllers/AdvancedController.php(94): Poly_PolycatalogSearch_Model_Advanced->getProductCollection()
#8 /home/www/client/www/CPT009/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Poly_PolycatalogSearch_AdvancedController->resultAction()
#9 /home/www/client/www/CPT009/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('result')
#10 /home/www/client/www/CPT009/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/www/client/www/CPT009/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/www/client/www/CPT009/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /home/www/client/www/CPT009/index.php(107): Mage::run('', 'store')
#14 {main}