On Magento I'm using a plugin wich pulls ekomi ratings.

On some articles I throws follwoing exception:

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 (state = '1') ORDER BY time DESC' at line 1, query was: SELECT main_table.* FROM meecom_ekomi_rating_cache AS main_table WHERE (()) AND (state = '1') ORDER BY time DESC

I've no idea what this means. Is there an easy fix for that?

Thanks for your help!

closed as off-topic by Rajeev K Tomy, Qaisar Satti, Murtuza Zabuawala, Fabian Schmengler, Raphael at Digital Pianism Dec 21 '16 at 10:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about third-party modules are generally off-topic because the scope of functionality and code are not available. For more information, see this meta post/answer." – Rajeev K Tomy, Qaisar Satti, Murtuza Zabuawala, Fabian Schmengler, Raphael at Digital Pianism
If this question can be reworded to fit the rules in the help center, please edit the question.


Looks like the plugin has a flaw in the code, specifically in the where statement.

Most likely the issue will be in a resource model. I'd suggest going to your: document_root/lib/Varien/Db/Adapter/Pdo/Mysql.php file and changing $_debug, $_logAllQueries, and $_logCallStack to true.

Once you've done that, and you re-run the application, you'll now see a log file generated in protected $_debugFile = 'var/debug/pdo_mysql.log';. Note that this is "loud" so it will log ALL sql queries....I'd suggest getting to the page where you know the error is being generated, and delete everything in the pdo_mysql.log file, then perform the necessary actions to generate the error.

You'll want to investigate the call stack to see what is causing the where clause to be empty...and then you'll want to modify the code appropriately.

I hope that helps...as I can't give you a specific answer without seeing the plugin code (as I haven't used that one before).

Not the answer you're looking for? Browse other questions tagged or ask your own question.