Magento Forum

Empty WHERE in advanced search
Jr. Member
Total Posts:  1
Joined:  2012-10-03

Hello all,

Can anyone point me in the correct direction for why advanced search is generating an empty WHERE clause?

Using the standard Advanced search PHP etc. MYSQL doesn’t like the empty where and it crashes the site.

MYSQL general log looks like this;

INSERT INTO `catalogsearch_result` (SELECT STRAIGHT_JOIN '1', `s`.`product_id`, MATCH (`s`.`data_index`) AGAINST ('' IN BOOLEAN MODEFROM `catalogsearch_fulltext` AS `sINNER JOIN `catalog_product_entity` AS `eON `e`.`entity_id`=`s`.`product_idWHERE () AND `s`.`store_id`='1'ON DUPLICATE KEY UPDATE `relevance`=VALUES(`relevance`)

Magneto SQL log looks like this;

Next exception 'Zend_Db_Statement_Exception' with message '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 ') AND `s`.`store_id`='1'ON DUPLICATE KEY UPDATE `relevance`=VALUES(`relevance`' at line 1' in /Users/kelvin/Projects/leacy_classics/lib/Zend/Db/Statement/Pdo.php:234


Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top