I am using fat-free-framwork to edit my user-table and try to update a date-field with:
$user = new DB\SQL\Mapper($db,TBL_USER);
$user->load('userID = 12');
$user->username = 'newUsername';
$user->datChanged = 'NOW()';
&user->update();
It changes the field 'username' proper but wont change the datetime-field 'datChanged' as the mapper puts the NOW() into quotes.
Any idea how to call the date-functions in the mapper?
It's not possible at the moment, because the mapper heavily uses prepared statements and you cannot bind functions to placeholders, because the underlaying PDO engine is stringifying these within the query preparation.
You could use this instead:
$user->datChaned = date('Y-m-d H:i:s');