开发者

how to call stored procedure on zend framework [closed]

As it currently stands, this q开发者_开发知识库uestion is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

how to call mysql stored procedure on zend framework?

any body may give an example?

thanks


See here:

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

Bill has answered it.


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜