title: How to solve syntax error in product detail page in magento?
body: <p>I have an error only in product detail page in magento</p>
  
  <pre><code>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
  </code></pre>
  
  <p>if i set original default theme it is not giving me any error,
  so what could be the issue?</p>
  
  <pre><code>There has been an error processing your request
  
  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
  
  Trace:
      #0 C:\wamp\www\dennymagic.com\store\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo-&gt;_execute(Array)
      #1 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql-&gt;_execute(Array)
     #2 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement-&gt;execute(Array)
       #3 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract-&gt;query('SELECT `mage_ca...', Array)
      #4 C:\wamp\www\dennymagic.com\store\lib\Varien\Db\Adapter\Pdo\Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract-&gt;query('SELECT `mage_ca...', Array)
       #5 C:\wamp\www\dennymagic.com\store\lib\Zend\Db\Adapter\Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql-&gt;query(Object(Varien_Db_Select), Array)
         #6 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Eav\Model\Entity\Abstract.php(943): Zend_Db_Adapter_Abstract-&gt;fetchRow(Object(Varien_Db_Select))
       #7 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Catalog\Model\Resource\Abstract.php(698): Mage_Eav_Model_Entity_Abstract-&gt;load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
       #8 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Model\Abstract.php(225): Mage_Catalog_Model_Resource_Abstract-&gt;load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
         #9 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Catalog\Block\Product\List.php(80): Mage_Core_Model_Abstract-&gt;load(Object(Mage_Catalog_Model_Category))
         #10 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Catalog\Block\Product\List.php(141): Mage_Catalog_Block_Product_List-&gt;_getProductCollection()
        #11 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(862): Mage_Catalog_Block_Product_List-&gt;_beforeToHtml()
        #12 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract-&gt;toHtml()
        #13 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(863): Mage_Core_Block_Text_List-&gt;_toHtml()
        #14 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(582): Mage_Core_Block_Abstract-&gt;toHtml()
          #15 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(526): Mage_Core_Block_Abstract-&gt;_getChildHtml('content', true)
        #16 C:\wamp\www\dennymagic.com\store\app\design\frontend\aaaa\bbb\template\page\2columns-right.phtml(36): Mage_Core_Block_Abstract-&gt;getChildHtml('content')
           #17 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Template.php(241): include('C:\wamp\www\den...')
          #18 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template-&gt;fetchView('frontend\aaa...')
         #19 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template-&gt;renderView()
         #20 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Block\Abstract.php(863): Mage_Core_Block_Template-&gt;_toHtml()
       #21 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract-&gt;toHtml()
         #22 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout-&gt;getOutput()
         #23 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Cms\Helper\Page.php(137): Mage_Core_Controller_Varien_Action-&gt;renderLayout()
       #24 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Cms\Helper\Page.php(52): Mage_Cms_Helper_Page-&gt;_renderPage(Object(Mage_Cms_IndexController), 'no-route')
       #25 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Cms\controllers\IndexController.php(75): Mage_Cms_Helper_Page-&gt;renderPage(Object(Mage_Cms_IndexController), 'no-route')
          #26 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Action.php(419):  Mage_Cms_IndexController-&gt;noRouteAction()
       #27 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action-&gt;dispatch('noRoute')
     #28 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard-&gt;match(Object(Mage_Core_Controller_Request_Http))
     #29 C:\wamp\www\dennymagic.com\store\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front-&gt;dispatch()
        #30 C:\wamp\www\dennymagic.com\store\app\Mage.php(683): Mage_Core_Model_App-&gt;run(Array)
       #31 C:\wamp\www\dennymagic.com\store\index.php(87): Mage::run('', 'store')
  </code></pre>