Can I run a query to remove likes given by poster X

Lone Wolf

Well-known member
I have had a few users sign up and then sign up additional accounts and use the other accounts to give themselves tons of likes
 
Thanks Jake. Is there any way to delete likes between certain posters. Eg delete only the likes poster A gave to poster X but not to poster Y or poster Z
 
he said SELECT * <---- you left out the *

Code:
SELECT *
FROM xf_liked_content
WHERE like_user_id = 2
AND content_user_id = 3;

Ok I tried that but now I'm getting this error...

#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 'LIMIT 0, 30' at line 5
 
Are you running this via PhpMyAdmin? There is no limit clause in the above query, but try removing the semi-colon.

Yes I am and removing the semi-colon worked, thanks. But it doesn't show me the posts which were liked. All I get is a content id. How do I convert this into the liked post. I want to see what was liked.
 
The content ID is the post ID.

This query is a little bit more complete:

Code:
SELECT liked.*, post.*, thread.*
FROM xf_liked_content AS liked
INNER JOIN xf_post AS post ON
    (liked.content_id = post.post_id)
INNER JOIN xf_thread AS thread ON
    (post.thread_id = thread.thread_id)
WHERE content_type = 'post'
    AND like_user_id = 2
    AND content_user_id = 3

That will show you the entire details of the like, the entire details of the post that was liked and the entire details of the thread that post was in.
 
Thanks Chris. The legends of your ninja xen skills are not exaggerated!

Is there any way to search xf_post for a word or phrase and then display the post content via a query
 
Code:
SELECT post.post_id, post.thread_id, post.message, thread.title
FROM xf_post AS post
INNER JOIN xf_thread AS thread ON
    (thread.thread_id = post.thread_id)
WHERE post.message LIKE '%resource%'
:)

Will display any post where the post content contains the word "resource". Will display the post_id, thread_id, message and the thread title.
 
Top Bottom