Code snippets for symfony 1.x

Navigation

Snippets by user shaheedulhaq sadi

Executing MySQL stored prodcedure in Symfony 1.2

I've written this code in my module action to get resultset returned by a stored procedure

$sql = sprintf('CALL sp_name(%s)', "parameter_value");      
 
$con_pdo = Propel::getConnection();
 
$result_pdo_stat = $con_pdo->query($sql);
 
$this->transactions = $result_pdo_stat->fetchAll(); //setting $transactions for my template
 

Please let me know if you find it useful

by shaheedulhaq sadi on 2010-06-24, tagged propel  storedprodcedure  symfony 
(1 comment)