Calling a stored procedure in PHP : PHP : Procedure Function MySQL TUTORIALS


MySQL TUTORIALS » Procedure Function » PHP »

 

Calling a stored procedure in PHP


$dbh = new mysqli($hostname, $username, $password, $database);
if (mysqli_connect_errno()) {
   printf("Connect failed: %sn", 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 %sn", $dbh->errno,$dbh->sqlstate,$dbh->error);      
}



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Procedure Function
» PHP