Call a stored procedure in PHP

Description

The following code shows how to call a stored procedure.

Example


<?php/*from   w w w .  ja v a 2  s. co m*/
  // Instantiate the mysqli class
  $db = new mysqli("localhost", "root", "", "test");

  // Execute the stored procedure
  $result = $db->query("CALL get_employees()");

  // Loop through the results
  while (list($employee_id, $name, $position) = $result->fetch_row()) {
     echo "$employee_id, $name, $position <br />";
  }

?>




















Home »
  PHP Tutorial »
    MySQL »




MySQLi
MySQLi Object Oriented