год назад запрос спокойно отрабатывал
а сейчас стал ругаться на синтаксис ошибкой
#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 'where `vote_id`=$active_vote_id ORDER BY `rk_vote_values`.`ip` ASC
LIMIT 0, 25' at line 10
понятно что могла версия mysql обновиться но это не должно влиять на синтаксис запроса
SELECT `cms`.`vote_values`.`user_id`,`cms`.`vote_values`.`username`,`ip`, count(*) as cnt,
count(CASE WHEN `user_vote`=5 THEN 1 ELSE NULL END) as cnt5,
count(CASE WHEN `user_vote`=4 THEN 1 ELSE NULL END) as cnt4,
count(CASE WHEN `user_vote`=3 THEN 1 ELSE NULL END) as cnt3,
count(CASE WHEN `user_vote`=2 THEN 1 ELSE NULL END) as cnt2,
count(CASE WHEN `user_vote`=1 THEN 1 ELSE NULL END) as cnt1,
`user_posts`,DATE_FORMAT(FROM_UNIXTIME(`user_regdate`), '%e %b %Y') AS 'date_formatted',`user_avatar`,`user_email`
FROM `cms`.`vote_values` left join `test`.`phpbb_users`
on `cms`.`vote_values`.`user_id`= `test`.`phpbb_users`.`user_id`
GROUP BY `cms`.`vote_values`.`user_id` where `vote_id`=5 ORDER BY `vote_values`.`ip` ASC