title: Retrieving Multiple Result sets with stored procedure in php/mysqli
body: <p>I have a stored procedure that has multiple result sets. How do I advance to the 2nd result set in mysqli to get those results?</p>
  
  <p>Let's say it's a stored proc like:</p>
  
  <pre><code>create procedure multiples( param1 INT, param2 INT )
  BEGIN
  
  SELECT * FROM table1 WHERE id = param1;
  
  SELECT * FROM table2 WHERE id = param2;
  
  END $$
  </code></pre>
  
  <p>The PHP is something like this:</p>
  
  <pre><code>$stmt = mysqli_prepare($db, 'CALL multiples(?, ?)');
  
  mysqli_stmt_bind_param( $stmt, 'ii', $param1, $param2 );
  
  mysqli_stmt_execute( $stmt );
  
  mysqli_stmt_bind_result( $stmt, $id );
  </code></pre>
  
  <p>Then this is the part I can't get to work. I've tried using mysqli_next_result to move to the next result set, but can't get it to work. We did get it to work with mysqli_store_result and mysqli_fetch_assoc/array/row, but for some reason all the ints get returned as blank strings.</p>
  
  <p>Any one else come across this and have a solution?</p>