Calling a stored procedure in PHP : PHP « Procedure Function « MySQL Tutorial






$dbh = new mysqli($hostname, $username, $password, $database);
if (mysqli_connect_errno()) {
   printf("Connect failed: %s\n", mysqli_connect_error());
   exit();
}

if ($dbh->query("call error_test_proc(1)"))  /*execute stored procedure*/
{
   printf("Stored procedure execution succeeded");
}
else // Stored procedure failed - show error
{
   printf("<P>Stored procedure error: MySQL error %d (SQLSTATE %s)\n %s\n", $dbh->errno,$dbh->sqlstate,$dbh->error);      
}








11.51.PHP
11.51.1.Calling a stored procedure in PHP
11.51.2.Using PHP to call a stored procedure and output the result
11.51.3.Calling a stored procedure in PHP and deal with the result