Hi
I haven't used stored procedure yet. But can we try this in cases
1. when stored procedure returns some value
$result = $this->Model->query("CALL 'stored-procedure-name'");
2. when stored procedure doesn't return any value
$this->Model->execute("CALL 'stored procedure name'");
Let me know weather it works..
Regards
On Oct 16, 8:11 pm, cmbg <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Just thought I'd post my workaround based on some of the posts here
> but I didn't see a consistent answer to the issue. My environment is
> PHP 5.2.3, Apache 2.2.6, and MySQL 5.0.41-community.
>
> So, here's the problem, I have a stored procedure that I want to call
> in Cake. When I try to run the $this->model->query("call
> sp_mine(params)"); or $this->model->_call, I don't get anything back
> and an mysql error occurs.
>
> Error 1312 - PROCEDURE <...> can't return a result set in the given
> context: nothing returned
>
> To resolve this, I had to modify the connect call to the database in
> dbo_mysql.php to include a client flag, specifically
> CLIENT_MULTI_RESULTS or CLIENT_MULTI_STATEMENTS or 65536. But after
> implementing this and calling my stored procedure I go another mysql
> error:
>
> Error 2014 - Commands out of sync; you can't run this command now
>
> I get this for any query or execute that I attempt to call. And per a
> post from blunt, I added this function
>
> function releaseDB() {
> $db =& ConnectionManager::getDataSource($this->useDbConfig);
> $db->disconnect();
> $db->connect();
> }
>
> to my model_php5.php. After every sp call, I call that method.
>
> If anyone has a better resolution or if it's fixed in the current cake
> version and I'm not doing something right, then let me know. :P
>
> Thanks,
> Beverly
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---