Saturday, November 29, 2008

Re: REgarding using Mysql functions like NOW(), CURDATE() etc

Sorry I just addressed your specific problem. As your cuestion about being able to call a mysql function, I think you are missing the point about cake's database abstraction layer so your application would become database dependant. If that is not an issue for you, try this link:

http://rafaelbandeira3.wordpress.com/2008/08/27/using-mysql-functions-with-cakephp-while-model-creation/

Finally if you are hopping that cake allow you to make mysql function calls inside a query you should read this
https://trac.cakephp.org/ticket/5345 as stateted that "it would actually make SQL injection a feature"

Regards,

FedeX

On Sat, Nov 29, 2008 at 4:59 PM, Malcolm Krugger <chennaiprogrammer@gmail.com> wrote:



"On Nov 29, 9:42 pm, the_woodsman <elwood.ca...@gmail.com> wrote:
> I don't think Federico has answered your general question about using
> MySQL functions,"

Yes correct.

and I would very much like to believe, that cakephp already has some
method(s) to harness the power of the multitude of Mysql functions
present here

http://dev.mysql.com/doc/refman/5.0/en/functions.html

So regarding using  Mysql functions in Cakephp. has it been documented
somewhere ?

I tried

 $this->data['User']['signedup'] = 'CURDATE()';

$this->User->save($this->data)


and

                       $this->data['User']['signedup'] = '!-CURDATE
()';
$this->User->save($this->data)


But it did not work !



Malcolm





--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: