Pushpendra
Pushpendra

Reputation: 4392

How to create or execute MySQL Procedure in Zend-Framework?

In my Zend-Framework project, I want to execute a MySQL Procedure that perform some complex search operation's.

But I don't have any idea about HOW to call or create PROCEDURE'S, if requires.

Please suggest some code.....

Thanks In Advance.

Upvotes: 2

Views: 2082

Answers (2)

Frank Heikens
Frank Heikens

Reputation: 127297

Zend_db_statement can take any piece of SQL.

Upvotes: 0

fin1te
fin1te

Reputation: 4351

You can do it similar to how you prepare/bind normal SELECT/INSERT queries

$stmt = $db->prepare('CALL procedure(:param1, :param2)');
$stmt->bindValue(':param1', 0);
$stmt->bindValue(':param2', 1000);
$stmt->execute();
$rows = $stmt->fetchAll();

Upvotes: 5

Related Questions