This blog is about the PHP solutions I have to think of when I'm developing systems almost every single day...

Monday, May 12, 2008

Using mysql functions in cakephp

Sometimes it's just easier to use mysql functions in the conditions. But cakephp automatically quote them. To disable the automatic quoting for any field just prefix the variable with a -! for example:


$notifications=$this->Notification->findAll(array('notification_date'=>'>= -!now()'));

1 comments:

Mareg said...

This not work for me, but the solution http://php.abdullahsolutions.com/search/label/conditions
is OK. Ohh so easy!!

Thaks very much.

Mareg

About Me

My Photo
Abdullah Zainul Abidin
I am what I am because of what I am...
View my complete profile