Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.3 KB

pdostatement-nextrowset.md

File metadata and controls

54 lines (40 loc) · 1.3 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic
PDOStatement::nextRowset
API reference for the PDOStatement::nextRowset function in the Microsoft PDO_SQLSRV Driver for PHP for SQL Server.
David-Engel
davidengel
08/10/2020
sql
connectivity
reference

PDOStatement::nextRowset

[!INCLUDEDriver_PHP_Download]

Moves the cursor to the next result set.

Syntax

  
bool PDOStatement::nextRowset();  

Return Value

true on success, false otherwise.

Remarks

Support for PDO was added in version 2.0 of the [!INCLUDEssDriverPHP].

Example

<?php  
   $server = "(local)";  
   $database = "AdventureWorks";  
   $conn = new PDO( "sqlsrv:server=$server ; Database = $database", "", "");  
  
   $query1 = "select * from Person.Address where City = 'Bothell';";  
   $query2 = "select * from Person.ContactType;";  
  
   $stmt = $conn->query( $query1 . $query2 );  
  
   $rowset1 = $stmt->fetchAll();  
   $stmt->nextRowset();  
   $rowset2 = $stmt->fetchAll();  
   var_dump( $rowset1 );  
   var_dump( $rowset2 );  
?>  

See Also

PDOStatement Class

PDO