Hello,

I have database model with field "altitude". This field is in MySQL
defined as: 
`altitude` decimal(5,1) default NULL,
So this field can be NULL.

But when in edit form user leave this field empty and I try update
model:
$this->Waypoint->save($this->data)

CakePHP generates this wrong query:
UPDATE table SET `id` = '9', ..some fields..., `altitude` = '' WHERE `id` = '9'
with this error:
Incorrect decimal value: '' for column 'altitude' at row 1

Altitude must be number or NULL, not empty string.

How can I say to CakePHP to use NULL instead of empty string when
model field (altitude) is not set ?

It is bug or I should handle this case manually (and how)?

-- 
 Michal Bilcik


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to