Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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.



85.4k
Accepted
answer

You have to enclose the value in double quotes:

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