(PECL mysqlnd-uh >= 1.0.0-alpha)
MysqlndUhConnection::storeResult — Transfère un jeu de résultats depuis la dernière requête
$connection
) : resourceTransfère un jeu de résultats depuis la dernière requête.
connection
Gestionnaire de connexion Mysqlnd. Ne pas modifier !
Une ressource de type
Mysqlnd Resultset (internal only - you must not modify it!)
.
La documentation peut aussi de référer à ce type de ressource sous l'alias
mysqlnd_resultset
.
Exemple #1 Exemple avec MysqlndUhConnection::storeResult()
<?php
class proxy extends MysqlndUhConnection {
public function storeResult($res) {
printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
$ret = parent::storeResult($res);
printf("%s returns %s\n", __METHOD__, var_export($ret, true));
var_dump($ret);
return $ret;
}
}
mysqlnd_uh_set_connection_proxy(new proxy());
$mysqli = new mysqli("localhost", "root", "", "test");
$res = $mysqli->query("SELECT 'Also called buffered result' AS _msg FROM DUAL");
var_dump($res->fetch_assoc());
$mysqli->real_query("SELECT 'Good morning!' AS _msg FROM DUAL");
$res = $mysqli->store_result();
var_dump($res->fetch_assoc());
?>
L'exemple ci-dessus va afficher :
proxy::storeResult(array ( 0 => NULL, )) proxy::storeResult returns NULL resource(475) of type (Mysqlnd Resultset (internal only - you must not modify it!)) array(1) { ["_msg"]=> string(27) "Also called buffered result" } proxy::storeResult(array ( 0 => NULL, )) proxy::storeResult returns NULL resource(730) of type (Mysqlnd Resultset (internal only - you must not modify it!)) array(1) { ["_msg"]=> string(13) "Good morning!" }