How to set float column value with php activerecord?

76 Views Asked by At

I have a table column

price FLOAT(10, 2) NOT NULL DEFAULT 0.00

And Model:

class Mytable extends \ActiveRecord\Model{
    static $table_name = 'my_table';
}

In php i use

$price = 23.54;

$obj = new Mytable();
$obj->price = $price;

$obj->save();

var_dump($price); // 23.54
var_dump($obj->price); // 23

Where is a problem?

0

There are 0 best solutions below