Hamlets666 Posted February 7, 2007 Share Posted February 7, 2007 Here is the code: SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM (( " . FORUMS_TABLE . " f LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id) LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id) Thing I want to add is a check, i want to select data from all those tables there gothic_forum_id is equal to $gf : WHERE f.gothic_forum_id = $gf AND p.gothic_forum_id = $gf AND u.gothic_forum_id = $gf Where shuld write it? I tried some ways and goth sql error. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 7, 2007 Share Posted February 7, 2007 Well, I'm confused about those parens... you don't need any of them, except maybe around the ON clause, for clarity. Once you've done that, the WHERE clause should go at the end, as usual. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.