Re: cake and Stored Procedures

2008-09-08 Thread Gonzalo Servat
Oops, pressed send by accident:

On Mon, Sep 8, 2008 at 6:52 PM, Gonzalo Servat <[EMAIL PROTECTED]> wrote:

> On Mon, Sep 8, 2008 at 6:30 PM, Gonzalo Servat <[EMAIL PROTECTED]> wrote:
>
>>
>> I'm not sure I have the right answer for you but, until somebody else
>> replies with a better answer, I believe if you use the mysqli driver (not
>> mysql) and the query contains "call" in it, it should work.
>>
>
Looking into it a little bit more, I think this is how you call your
procedure:

class YourModel extends AppModel {
.
.
function procedureName() {
   return $this->execute( "call sqlprocname()" );
}
}

... and from a controller:

$results = $this->YourModel->procedureName();

- Gonzalo

>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: cake and Stored Procedures

2008-09-08 Thread Gonzalo Servat
On Mon, Sep 8, 2008 at 6:30 PM, Gonzalo Servat <[EMAIL PROTECTED]> wrote:

>
> I'm not sure I have the right answer for you but, until somebody else
> replies with a better answer, I believe if you use the mysqli driver (not
> mysql) and the query contains "call" in it, it should work.
>

Looking into it a little bit more, it looks like you can call your stored
procedure from a model:

class YourModel extends AppModel {
.
.
function procedureName() {
   $this->execute( "call sqlprocname()" );

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



Re: cake and Stored Procedures

2008-09-08 Thread Gonzalo Servat
On Mon, Sep 8, 2008 at 5:59 PM, Car For Sale Sign  wrote:

>
> Hi -
>
> I am considering using Cake and Stored procedures for a new app that I
> am going to write.  Does anyone have any suggestions on using SPs with
> cake.
>

I'm not sure I have the right answer for you but, until somebody else
replies with a better answer, I believe if you use the mysqli driver (not
mysql) and the query contains "call" in it, it should work.

- Gonzalo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---



cake and Stored Procedures

2008-09-08 Thread Car For Sale Sign

Hi -

I am considering using Cake and Stored procedures for a new app that I 
am going to write.  Does anyone have any suggestions on using SPs with cake.

Thanks

 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---