Calling a stored procedure in PHP and deal with the result
Employee listing
Employee listing
query("call employee_list( $dept_id )")) {
print ('
'.
'Employee_id | Surname | Firstname |
');
while ($row = $result_set->fetch_object()) {
printf("%s | %s | %s |
\n",
$row->employee_id, $row->surname, $row->firstname);
}
} else {
printf("Error:%d (%s) %s\n", mysqli_errno($dbh),
mysqli_sqlstate($dbh), mysqli_error($dbh));
}
print ("
");
$dbh->close();
}
?>