Hi,

Is there a way to insert an expression as a value using the Insert class?

use Zend\Db\Sql\Insert,
        Zend\Db\Sql\Expression;
...
$insert = new Insert('test');
$insert->values(array(
'ip_address' => $_SERVER['REMOTE_ADDR'],
'added' => *new Expression('NOW()')*
));
$statment = $dbAdapter->createStatement();
$insert->prepareStatement($dbAdapter, $statment);
$statment->execute();

Throws an error:
PHP Catchable fatal error:  Object of class Zend\Db\Sql\Expression could not
be converted to string in /****/Zend/Db/Adapter/Driver/Mysqli/Statement.php
on line 209

Any ideas?

Thanks!!

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Zend-Db-Sql-Insert-new-Expression-now-tp4536197p4536197.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to