PDOStatement::closeCursor
Closes the cursor, enabling the statement to be executed again.
Syntax
bool PDOStatement::closeCursor();
Return Value
true on success, otherwise false.
Remarks
closeCursor has an effect when the MultipleActiveResultSets connection option is set to false. For more information about the MultipleActiveResultSets connection option, see How to: Disable Multiple Active Resultsets (MARS).
Instead of calling closeCursor, you can also just set the statement handle to null.
Support for PDO was added in version 2.0 of the Microsoft Drivers for PHP for SQL Server.
Example
<?php
$database = "AdventureWorks";
$server = "(local)";
$conn = new PDO( "sqlsrv:server=$server ; Database = $database", "", "", array('MultipleActiveResultSets' => false ) );
$stmt = $conn->prepare('SELECT * FROM Person.ContactType');
$stmt2 = $conn->prepare('SELECT * FROM HumanResources.Department');
$stmt->execute();
$result = $stmt->fetch();
print_r($result);
$stmt->closeCursor();
$stmt2->execute();
$result = $stmt2->fetch();
print_r($result);
?>
See Also
Povratne informacije
https://aka.ms/ContentUserFeedback.
Stiže uskoro: Tijekom 2024. postupno ćemo ukinuti servis Problemi sa servisom GitHub kao mehanizam za povratne informacije za sadržaj i zamijeniti ga novim sustavom za povratne informacije. Dodatne informacije potražite u članku:Pošaljite i pogledajte povratne informacije za