|
|||
|
How can i make a query like
Code:
INSERT INTO `table` (`datetime`) VALUES (NOW()) The problem is i can't insert a result of a MySQL function. Please, don't suggest generating datetime in PHP. |
|
|||
|
Use Zend_Db_Expr. An example from ZF docs:
Code:
<?php
$table = new Bugs();
$data = array(
'created_on' => new Zend_Db_Expr('CURDATE()'),
'bug_description' => 'Something wrong',
'bug_status' => 'NEW'
);
|
|
|||
|
I remember it was somwhere in the docs, but searched for it for 2 days and couldn't find.
Thanks! Could you provide a link where exactly it was? |
|
|||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|