I just started my first yii project, generated with gii.
My database table has a decimal field "price" created with the following migration:
$this->createTable('tbl_products', array(
...
'price' => 'DECIMAL(15,6)'
When I create a new product and try to save the edit form, the following CDbException occurs:
CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: ‘’ for column ‘price’ at row 1. The SQL statement executed was: INSERT INTO tbl_products
…
I need to save products without a price.
How to implement this?
The mysql price column is allowed to save NULL values.