Using PHP to call a stored procedure and output the result
Department listing
Department ID |
Department Name |
query("call department_list()"))
{
printf('');
while($row=$result_set->fetch_object())
{
printf("
%s | %s |
\n",
$row->department_id, $row->department_name);
}
}
else // Query failed - show error
{
printf("Error retrieving stored procedure result set:%d (%s) %s\n",
mysqli_errno($dbh),mysqli_sqlstate($dbh),mysqli_error($dbh));
$dbh->close();
exit();
}
/* free result set */
$result_set->close();
$dbh->close();
?>