I am using the Zend Framework with the MySQL PDO adapter and I want to use the function in my insert statement. Basically, the SQL I want to generate is as follows:
INSERT INTO `myTable` (`leftId`, `rightId`, `date`) VALUES ($left, $right, NOW())
This is the code in my model:
$data = array( "leftId" => $left, "rightId" => $right, "date" => "NOW()" ); $this->insert($data);
This is trying to insert "NOW()" , not NOW() :
Common error: 1292 Invalid date and time value: "NOW ()" for the "date" column in row 1
How can I do it?
source share