CodeIgniter Forums
One connection for many MySQL Stored Procedures - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: One connection for many MySQL Stored Procedures (/showthread.php?tid=52578)



One connection for many MySQL Stored Procedures - El Forum - 06-17-2012

[eluser]Unknown[/eluser]
I've noticed people have had some problems with using one connection for multiple stored procedures. Has this been resolved by CI? Should I stick to using one connection per stored procedure or can I safely use this in one db->query call? I was worried about having to call a stored procedure many time for a batch insert now it's looking like I can't even limit the overhead to one connection >.>

Code:
foreach($foo as $bar) {
  $params = array($bar, $ram, $sheep);
  $this->db->query("CALL ins_foo(?, ?, ?)", $params);
}