Jump to content

Need help with LEFT JOIN


Hamlets666

Recommended Posts

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.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/37475-need-help-with-left-join/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.