MainelyDesign.com Blog

Inserting NOW() into MySQL Using CakePHP

Posted on 08/11/2011 at 11:16 pm by Kevin Wentworth
Viewed 14,920 times | 0 comments

Great find.  If you want to insert NOW() into your query using CakePHP's save() or saveAll() functions, you can use the following expression:

  1. $this->data['Model']['custom_date_field'] = DboSource::expression('NOW()');

Not sure how it works on MSSQL, but I will be testing that soon.

Cheers,
-Kevin Wentworth

Bookmark and Share

Tags for Inserting NOW() into MySQL Using CakePHP

Cakephp | Database | Mysql | Mssql | Web Programming | Usage

Comments for this Posting

No comments. Be the first to post a reply.

Sorry, comments are closed for this posting.

Please Email Kevin if you have any questions. Thanks!

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design