title: Multiple result set in PHP?
body: <p>In .NET SqlDataReader can retrieve multiple record set:</p>
  
  <pre><code>    Dim Connection As New SqlConnection(SomeConnectionString)
      'Note that the command will generate three result
      Dim Command As New SqlCommand("select '1a', '1b'; " &amp; _
          "select '2a', '2b', '2c'; " &amp; _
          "select '3a', '3b'; ", Connection)
      Dim Reader As SqlDataReader
  
      Connection.Open()
  
      Reader = Command.ExecuteReader
  
      Do
          While Reader.Read
              'Do something with the data
          End While
      Loop While (Reader.NextResult) 'Proceed to next result
  
      Reader.Close()
      Connection.Close()
  </code></pre>
  
  <p>The <code>.NextResult</code> moves the reader to the next result. How to do this in PHP? I basically want to avoid many round trips to the database.</p>
  
  <p>Note: <code>.Read</code> here moves the next row while <code>.NextResult</code> moves to the next result.</p>
  
  <p>1 query, 3 results:</p>
  
  <p>result 1</p>
  
  <pre><code>1a 1b
  </code></pre>
  
  <p>result 2</p>
  
  <pre><code>2a 2b 2c
  </code></pre>
  
  <p>result 3</p>
  
  <pre><code>3a 3b
  </code></pre>
  
  <p>Note: Row is not equal to result. Result is much more like a table or set of rows.</p>