Hi,

I noticed that cakephp will not allow to update registers with primary
key with 0 or '0' :

for example:

$this->data->id = '0';  //   or ->id = 0
$this->save($this->data);

Will not work if a register with id=0 already exists due it will
understand it as id = false (new register) and will produce a
duplicated id MySQL error.

Why using a register with id = 0? : Maybe it will not make sense with
a numeric primary key (but MySQL allows it), but when thinking in a
non numeric primary key (like id = 'product-1234',), it makes sense:

cake will allow id = '00' and will allow id = '000' but will not allow
update on id = '0'

My question is: is this a cakephp bug?

I'm using cakephp 1.2.6311

thanks



--~--~---------~--~----~------------~-------~--~----~
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