$sql = "SELECT id, poster_id, poster_name, file_name, title, message, date,
MATCH(title, message, file_name) AGAINST('" . $search . "') AS score
FROM posts INNER JOIN favorites ON favorites.post_id = posts.id
WHERE favorites.user_id = '$user_id' AND MATCH(title, message, file_name) AGAINST('" . $search . "')
ORDER BY rank DESC, date DESC, score DESC";
Yet when I do this, without joining favorites, it works just fine.
$sql = "SELECT id, poster_id, poster_name, file_name, title, message, date,
MATCH(title, message, file_name) AGAINST('" . $search . "') AS score
FROM posts
WHERE MATCH(title, message, file_name) AGAINST('" . $search . "')
ORDER BY rank DESC, date DESC, score DESC";
To be clear, I'm sure that the posts I'm searching for are in the favorites table. So I'm positive it's an issue with my query. Can anyone pin point what I'm doing wrong here?
This post has been edited by itdoell: 02 December 2011 - 05:57 AM

New Topic/Question
Reply




MultiQuote





|