I have a Stored Procedured which creates a temporary table (#test), fills it with data from another table, runs 3 selects on this temporal table and drops it.
The or
I was actually just having a similar issue and managed to get the following to work:
$result = array();
// Get return value
do {
while ($row = sqlsrv_fetch_array($query)) {
// Loop through each result set and add to result array
$result[] = $row;
}
} while (sqlsrv_next_result($query));
print_r($result);
The do-while loop will advance through all results (rather than having to do this manually). It seems that looping through sqlsrv_fetch_array() is essential so I think this is the real answer.