note 114693 added to function.sqlsrv-next-result
| From: | chakin | Date: | Mon, 24 Mar 2014 01:09:09 +0000 |
| Subject: | note 114693 added to function.sqlsrv-next-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199034@lists.php.net to get a copy of this message | ||
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;
}
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 54.240.196.169
----
Manual Page -- http://php.net/manual/en/function.sqlsrv-next-result.php
Edit -- https://master.php.net/note/edit/114693
Del: integrated -- https://master.php.net/note/delete/114693/integrated
Del: useless -- https://master.php.net/note/delete/114693/useless
Del: bad code -- https://master.php.net/note/delete/114693/bad+code
Del: spam -- https://master.php.net/note/delete/114693/spam
Del: non-english -- https://master.php.net/note/delete/114693/non-english
Del: in docs -- https://master.php.net/note/delete/114693/in+docs
Del: other reasons-- https://master.php.net/note/delete/114693
Reject -- https://master.php.net/note/reject/114693
Search -- https://master.php.net/manage/user-notes.php