ich bastle gerade was und stehe vor einem kleinen Problem, was ich nicht wirklich nachvollziehen kann. Vielleicht hast Du die zündende Idee.
Ich habe folgende Suchabfrage:
Code: Alles auswählen
$sql = "SELECT s.media_id, s.media_title, s.media_desc, s.media_singer, s.media_user_id, s.media_user_ip, s.media_username, s.media_time, s.media_cat_id, s.media_view_count, u.user_id, u.username, r.rate_media_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment
FROM ". MMC_TABLE ." AS s
LEFT JOIN ". USERS_TABLE ." AS u ON s.media_user_id = u.user_id
LEFT JOIN ". MMC_CAT_TABLE ." AS ct ON s.media_cat_id = ct.cat_id
LEFT JOIN ". MMC_RATE_TABLE ." AS r ON s.media_id = r.rate_media_id
LEFT JOIN ". MMC_COMMENT_TABLE ." AS c ON s.media_id = c.comment_media_id
WHERE s.media_title LIKE '%" . $search . "%'
GROUP BY s.media_id
ORDER BY s.media_time DESC
LIMIT ".$limit_sql."";
Komplett-durchdreh-weil-nicht-versteh ....
Schönen Gruß
Felix