note 60448 deleted from mysql.real-query by danbrown

From: Date: Fri, 28 Nov 2008 22:11:16 +0000
Subject: note 60448 deleted from mysql.real-query by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147310@lists.php.net to get a copy of this message
Note Submitter: Beeners ---- Stored Procedures. In order to call a stored procedure that returns a result set, use mysqli_real_query. Here is a short example: $mysqli = new mysqli(DBURI,DBUSER,DBPASS,DBNAME); if (mysqli_connect_errno()) { printf("Connection failed: %s\n", mysqli_connect_error()); exit(); } $SQL = "CALL my_procedure($something)"; if (!$mysqli->real_query($SQL)) { printf("Invalid query: %s\nWhole query: %s\n", $mysqli->error, $SQL); exit(); } if ($result = $mysqli->store_result()) { while ($myrow = $result->fetch_array(MYSQLI_ASSOC)) { $aValue[]=$myrow["a"]; $bValue[]=$myrow["b"]; } $result->close(); } $mysqli->close(); I hope this saves someone some time.

« previous php.notes (#147310) next »