XF 2.2 SQL-Statement to count Likes, not working with XF 2.2

vFranky

Active member
Hello,

I like to count the likes from each user in 2021. In recent years, I used the SQL string below, which works fine. But this year, I get an error message "#1146 - Table 'wa9301_db18.xf_liked_content' doesn't exist".

Was there any change from XF 2.1 to XF 2.2? Any idea or tips?
Thank you in advance!

Kind regards,
Frank


Code:
SELECT COUNT(*) AS likes, xf_user.user_id, xf_user.username
FROM xf_liked_content
INNER JOIN xf_user ON (xf_user.user_id = xf_liked_content.content_user_id)
WHERE xf_liked_content.like_date > 1609459200
GROUP BY xf_user.user_id
ORDER BY likes DESC
 
The change happened from 2.0 to 2.1 ;)


Assuming that reaction Like has the default reaction ID 1:
Code:
SELECT COUNT(*) AS likes, xf_user.user_id, xf_user.username
FROM xf_reaction_content
INNER JOIN xf_user ON (xf_user.user_id = xf_reaction_content.content_user_id)
WHERE xf_reaction_content.reaction_id = 1
    AND xf_reaction_content.reaction_date > 1609459200
GROUP BY xf_user.user_id
ORDER BY likes DESC
 
Top Bottom