CodeIgniter Forums
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: Stored Procedures (/showthread.php?tid=10795)



Stored Procedures - El Forum - 08-12-2008

[eluser]coolant[/eluser]
I am trying to use stored procedures and CI together. When I call the command through terminal, I get the result

Code:
mysql> call moo();
+-----------+
|   user_id |
+-----------+
|         1 |
+-----------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

But when I run this

Code:
$query = $this->db->query('call moo();');
print_r ( $query->result_array( ) );

I get the following error

Quote:<h1>A Database Error Occurred</h1>
<p>Error Number: 1312</p><p>PROCEDURE users.moo can't return a result set in the given context</p><p>call moo();</p>

Any ideas how to fix this?

Thanks!


Stored Procedures - El Forum - 08-12-2008

[eluser]coolant[/eluser]
Changed from mysql to mysqli = problems over.