1

how to call mysql stored procedure on zend framework?

any body may give an example?

thanks

ulduz114
  • 1,150
  • 6
  • 21
  • 37

2 Answers2

4

See here:

How can I use a stored procedure in a MySql database with Zend Framework?

Bill has answered it.

Community
  • 1
  • 1
Layke
  • 51,422
  • 11
  • 85
  • 111
3

Let the procedure be example:

CREATE PROCEDURE example ()

BEGIN
  SELECT DISTINCT(licence) FROM applications WHERE `licence` > 0;
END

Then in your PHP code:

$db = Zend_Registry::get('db');
$stmt = $db->query("CALL sp_distinctlicence()");

$data = $stmt->fetchAll();
Zend_Debug::dump($data,$label=null, $echo=false);
Florent
  • 12,310
  • 10
  • 49
  • 58