I have 3 tables:
users
userid | pseudo
posts
id | titre
posts_com
id | userid | id_billet | auteur | date | html
I need to list the lasts posts_com with their post id owner and user owner... I tryied this query but the results are not corrects... Any idea please?
SELECT c.userid,
c.id_billet,
c.auteur,
c.date,
c.html,
u.pseudo,
b.titre,
b.id
FROM posts_com AS c,
users AS u,
posts AS b
WHERE u.userid=b.userid
ORDER BY c.id DESC
LIMIT 12
[EDIT] I need :
-> comment 1 (html) from auteur on post titre (user foo)
-> comment 2 (html) from auteur2 on post titre2 (user foo2) ...
posts_comtable (i.e. how that table relates to the others).