cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG] Phalcon 1.3.1 Error on saving model with whitelist fields

Open joeyew opened this issue 12 years ago • 2 comments

    $user = new Users();
    $fields = array('username', 'age', 'created_at');
    $user->save(array('username'=>'john', 'age'=>18), $fields);
    echo $user->age;

above will be output 1 because phalcon changed the integer value 18 to true. I manage to solved the problem with changed the integer 18 to string '18'.

joeyew avatar Apr 03 '14 09:04 joeyew

Are you use mysql? If so, the problem may be resolved in 1.3.2 https://github.com/phalcon/cphalcon/pull/2255

dreamsxin avatar Apr 07 '14 00:04 dreamsxin

Noted. Thanks, dreamsxin

joeyew avatar Apr 07 '14 01:04 joeyew