one more time I turn to you for asking about mysql, definitely not my best skill. In fact, seems not to be very complex. This is my simplified scenario, I have two tables, one for posts, another for likes to posts:
Table post_forum structure
id thread post likes user_id created
Table likes_to_post structure
id post_id user_id created
This is my query for obtain posts from $start to $next for a thread $thread_id:
$query = "SELECT
post_forum.id,
post_forum.user_id,
post_forum.post,
post_forum.likes,
post_forum.created
FROM post_forum
WHERE post_forum.thread ='{$thread_id}'
ORDER BY post_forum.id DESC LIMIT $start,$next";
What I want to do is get por every post, a 0
or 1
value for a field saying if the user $user_id
has liked every post, being $user_id
the id of user that asks the post, in one query if possible.
Thanks a lot in advance, any help is appreciated.