We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Problem : Assign RawValue

I had an error when assigning field with RawValue like this

$record = new Model();
$record->status = new \Phalcon\Db\RawValue('DD/MM/YYYY');

Error:

Column not found: 1054 Unknown column 'DD' in 'field list

Is there something wrong? Thanks.



98.9k
Accepted
answer

You have to enclose the value in double quotes:

$record = new Model();
$record->status = new \Phalcon\Db\RawValue('"DD/MM/YYYY"');