title: Using JOIN when all 3 tables have same columns MYSQL
body: <p>I have 3 tables they are...</p>
  
  <ul>
  <li>posts_deletedPosts</li>
  <li>posts_archivedPosts</li>
  <li>posts_newPosts</li>
  </ul>
  
  <p>I am writing a function which allows users to see all of their posts and so I want to do a join query to pull all the data from these three tables back in one query.</p>
  
  <p>All three tables has the exact same columns I want to get back, and they are...</p>
  
  <ul>
  <li>title</li>
  <li>category</li>
  <li>dateCreated</li>
  <li>alias</li>
  </ul>
  
  <p>The query i've written so far I think should work, but when I go to use bind param I get this error.</p>
  
  <pre><code>Warning: mysqli_stmt::bind_result() [mysqli-stmt.bind-result]: Number of bind variables doesn't match number of fields in prepared statement
  </code></pre>
  
  <p>My query looks like as follows...</p>
  
  <pre><code>  $stmt = $this-&gt;conx-&gt;prepare("SELECT 
      dp.title, dp.category, dp.dateCreated, dp.alias, 
      ap.title, ap.category, ap.dateCreated, ap.alias, 
      np.title, np.category, np.dateCreated, np.alias 
      FROM posts_deletedPosts AS dp 
          INNER JOIN posts_archivedPosts AS ap 
              ON dp.author = ap.author 
          INNER JOIN posts_newPosts AS np 
              ON dp.author = np.author 
      WHERE dp.author = ? 
      LIMIT 5");
  </code></pre>
  
  <p>I'm pretty new to web dev but I thought it would be possible to carry out a join like this and return one large dataset. I did use 3 select queries before but I want to build some pagination using AJAX and so I need this data in one complete set preferably.</p>
  
  <p>This is how i bind the parameter</p>
  
  <pre><code>$stmt-&gt;bind_param("i",$uid);
  </code></pre>