Code snippets for symfony 1.x

Navigation

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 

Comments on this snippet

gravatar icon
#1 pedro lima on 2010-06-24 at 03:36

Nice!