By taqwa on
I saw this in my log:
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 'node' AND votingapi_vote_vote_votes.value_type = 'votes' AND votingapi_vote_vote' at line 1 query: SELECT DISTINCT(node.nid), DATE_FORMAT(FROM_UNIXTIME(node.created), '%Y%m%) AS node_created_orderby, votingapi_vote_vote_votes.value AS votingapi_vote_vote_votes_value, node.title AS node_title, node.changed AS node_changed FROM node node LEFT JOIN votingapi_vote votingapi_vote_vote_votes ON node.nid = votingapi_vote_vote_votes.content_id AND votingapi_vote_vote_votes.content_type = 'node' AND votingapi_vote_vote_votes.value_type = 'votes' AND votingapi_vote_vote_votes.tag = 'vote' WHERE (node.status = '1') AND (node.type IN ('aggregation_item','storylink')) ORDER BY node_created_orderby DESC, votingapi_vote_vote_votes_value ASC, node_title ASC LIMIT 0, 20 in /home/.roy/lukas2000/islamicpulse.com/includes/database.mysql.inc on line 172.
Comments
My guess is that the WHERE
My guess is that the WHERE keyword should be moved two ANDs to the left. The ON clause after a LEFT JOIN probably expects two table names or aliases, and saying "votingapi_vote_vote_votes.content_type = 'node'" uses only one. Move it and the pieces after it to after the WHERE.
If you were the one who wrote this query, I have to ask why you made the alias of votingapi_vote longer than its name. Aliases are meant to improve readability. Seeing the word "vote" in there so many times nearly made my eyes cross.
-----
Übercart -- One cart to rule them all.