title: How to combine 2 mysql queries into 1 with different where clause
body: <p>So I need help combining 2 mysql query's into 1 query. 
  So that I can insert the query into a foreach loop with php, but I'm stuck because I don't know how to do that yet! Please help.</p>
  
  <p>I Would like it to return all the columns that I selected.</p>
  
  <p>QUERY 1 :</p>
  
  <pre><code>SELECT b.id, b.post_text, c.default_photo, d.first_name, e.status 
  FROM posts b 
  INNER JOIN profiles c 
  INNER JOIN users d 
  INNER JOIN friendship e 
  ON b.from_user = c.user_id 
  AND b.from_user = d.id 
  AND e.friend_id = b.from_user 
  WHERE e.status = 'Friend' 
  AND e.user_id = :id
  ORDER BY b.id DESC
  </code></pre>
  
  <p>QUERY 2:</p>
  
  <pre><code>SELECT b.id, b.by_who_id, b.photo_dir, c.default_photo, d.first_name, e.status
  FROM photos b 
  INNER JOIN profiles c 
  INNER JOIN users d 
  INNER JOIN follower e 
  ON b.by_who_id = c.user_id 
  AND b.by_who_id = d.id 
  AND e.from_user = b.from_user 
  WHERE e.status = 'Following' 
  AND e.following_who_id = :id
  ORDER BY b.id DESC
  </code></pre>
  
  <p>Both query's work but I need help combining them.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>ok so query 1 works perfect now the reason i want query 1 and 2 together is because it fetches data if the user is following that "something". but if he isn't following that "something" then it doesnt return anything now i want all the columns to return together.</p>
  
  <p>idk if that makes sense let me know</p>