Wednesday, September 30, 2009

Problem with saving id's

Hi everyone,

I've got a little problem with my cake app'.

My database is Oracle. Every data saving handled by cake engine works
fine.
The problem is with a 'manual' saving :

$this->User->Planification->create($data_planification);

$data_planification["Planification"]["user_id"] = $_POST
['user_id'];
$data_planification["Planification"]["projet_id"] = $_POST
['projet_id'];


$this->User->Planification->save($data_planification);

This code doesn't work with my Oracle database while it used to work
with MySQL database.
When i add this line at the begining :
$data_planification["Planification"]["id"] = 5678;
It works, so i guess i've got a problem with my id. I thought that
cake generate automatically id's and then save them in the database.
I've created sequences, maybe i must retrieve the current sequence ?
Or is there a thing that i've missed ?

Thanks for any help.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: