I think when you call a model function that is not a function in your app_model derived model, cake tries to pass ti to the db. If you do from a controller, $this->Model->myfunction and my function does not exist in model, you get a Db error as "unkown function in MySql"... Maybe (I haven't tried) this could be the way of calling a db store proc..
On Oct 25, 10:59 pm, cmbg <[EMAIL PROTECTED]> wrote: > Hrmm.. okay -- digging into this further. > > Looks like I was using the wrong database driver. I should have been > using 'mysqli' instead of 'mysql'. > > On Oct 16, 11:11 am, 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 cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---