fife Posted July 12, 2012 Share Posted July 12, 2012 I have a tripple join that is working as it should. How ever I want it to bring back all results even it there are no results in the news table. There will always be a network but not news for a network. Here is the query SELECT news.*, members.*, networks.* FROM news INNER JOIN members ON members.idmembers = news.idmember INNER JOIN networks ON networks.idnetworks = news.idnetwork WHERE news.idnetwork='".$_GET['network']."' ORDER BY news.idnews DESC Ive tried left join and right join on the second inner join but still it does not bring back any results. if there is a news item it works great but it needs to without a news item Quote Link to comment Share on other sites More sharing options...
Barand Posted July 12, 2012 Share Posted July 12, 2012 try $sql = "SELECT * FROM networks LEFT JOIN news ON networks.idnetworks = news.idnetwork LEFT JOIN members ON members.idmembers = news.idmember WHERE networks.idnetworks = {$_GET['network']} ORDER BY news.idnews DESC"; Quote Link to comment Share on other sites More sharing options...
fife Posted July 12, 2012 Author Share Posted July 12, 2012 ok ive tried left left, right right, right left and left right but none of them display if there is no article in the news table Quote Link to comment Share on other sites More sharing options...
fife Posted July 12, 2012 Author Share Posted July 12, 2012 Brand thank you Quote Link to comment Share on other sites More sharing options...
fife Posted July 12, 2012 Author Share Posted July 12, 2012 barand even 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.