title: Get results from two tables from id and following id
body: <p>Since I am quite  pixilated sometimes I asked wrong question before.
  Now this is what I'm trying to accomplish.</p>
  
  <p>Im trying to get the values from <code>user.id = 1</code> and the values of the user that <code>user.id = 1</code> is following.</p>
  
  <p>But I ether get the results from <code>user.id 1</code> or in this case the followed <code>following.follow_id = 2</code>.
  Any ideas ?</p>
  
  <p>I have created a SQLfiddle for showing. As you see the only result I get is from user_one.</p>
  
  <p><a href="http://sqlfiddle.com/#!2/6a39f/1" rel="nofollow">http://sqlfiddle.com/#!2/6a39f/1</a></p>
  
  <pre><code>SELECT user.email, 
  user.username, 
  tweets.message, 
  tweets.date, 
  userdetails.profile_img, 
  userdetails.firstname, 
  userdetails.lastname, 
  following.id, following.user_id, 
  following.follow_id
  FROM user
  JOIN userdetails ON user.id = userdetails.user_id
  JOIN tweets ON userdetails.user_id = tweets.user_id
  LEFT JOIN following ON user.id = 1
  WHERE following.user_id = 1 
  </code></pre>
  
  <p>Tables:</p>
  
  <p><strong>Tweets</strong></p>
  
  <blockquote>
    <p>user_id | id | date | message</p>
  </blockquote>
  
  <p><strong>user</strong></p>
  
  <blockquote>
    <p>id | email | password | username</p>
  </blockquote>
  
  <p><strong>userdetails</strong></p>
  
  <blockquote>
    <p>id | firstname | lastname | profile_img | user_id | about</p>
  </blockquote>
  
  <p><strong>following</strong></p>
  
  <blockquote>
    <p>id | user_id | follow_id</p>
  </blockquote>
  
  <p>In this case following table has value</p>
  
  <pre><code> user_id = 1 and follow_id = 2
  </code></pre>
  
  <p>summary .</p>
  
  <pre><code>User_id = 1 is following follow_id = 2
  </code></pre>
  
  <p>But i only get results from <code>user_id = 1</code> and not from both.
  Thanks.</p>
  
  <p>Basicly Im trying to combine this two querys.</p>
  
  <p>Query for getting the results from the user thats been followed.</p>
  
  <pre><code>SELECT user.email, 
  user.username, 
  tweets.message, 
  tweets.date, 
  userdetails.profile_img, 
  userdetails.firstname, 
  userdetails.lastname, 
  following.id, following.user_id, 
  following.follow_id
  FROM user
  JOIN userdetails ON user.id = userdetails.user_id
  JOIN tweets ON userdetails.user_id = tweets.user_id
  JOIN following ON following.follow_id
  WHERE following.follow_id = tweets.user_id AND following.user_id  = '1' ORDER BY tweets.date DESC 
  </code></pre>
  
  <p>And the query for fetching the value of user 1</p>
  
  <pre><code>SELECT user.email, 
  user.username, 
  tweets.message, 
  tweets.date, 
  userdetails.profile_img, 
  userdetails.firstname, 
  userdetails.lastname
  FROM user
  JOIN userdetails ON user.id = userdetails.user_id
  JOIN tweets ON userdetails.user_id = tweets.user_id
  WHERE user.id = '1'  ORDER BY tweets.date DESC
  </code></pre>