Posted: 19.09.2004 13:54 Post subject: SQL select iz 3 tablice...
$sql = "SELECT t.topic_id, t.topic_title, p.poster_id, p.post_time
FROM phpbb_topics t, phpbb_posts p
WHERE t.topic_last_post_id=p.post_id
ORDER BY topic_last_post_id DESC
LIMIT 0, 5";
jos bih trebao da mi selektira "username" iz "phpbb_users" gdje je "user_id" jednak "p.poster_id"
Joined: 25 Aug 2003 Posts: 1842 Location: Zagreb, Hrvatska
Posted: 20.09.2004 09:49 Post subject:
Najjednostavnije:
Code:
SELECT t.topic_id, t.topic_title, p.poster_id, p.post_time, u.username
FROM phpbb_topics t, phpbb_posts p, phpbb_users u
WHERE t.topic_last_post_id=p.post_id AND p.poster_id = u.user_id
ORDER BY topic_last_post_id DESC
LIMIT 0, 5;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum