Voting

: nine plus zero?
(Example: nine)

The Note You're Voting On

chakin
11 years ago
You can use a for loop to iterate through the results:

If you know how many results there should be it's easier, otherwise you can put a large number in the loop constructor and break when done:

<?
for ($i=0; $i< (Large # or Exact #); $i++)
{
$rows_affected = sqlsrv_rows_affected($q2);
if ($rows_affected === false)
{
echo 'Inserts Failed<br />\n';
} else if ( $rows_affected == -1) {
echo "No information available.<br />\n";
} else {
echo $rows_affected." rows were added.<br />\n";
}

$next_result = sqlsrv_next_result($q2);

if (!$next_result)
{
break;
}
}
?>

<< Back to user notes page

To Top