Month: February 2009

CakePHP model updating instead of inserting.

Posted by on February 19, 2009

Cake 1.1’s documentation is a little lacking, again.

I was having a bug where a model was updating instead of inserting, even though I was sending in an array with all of the model’s attribute except for the id. In order to get the save function to insert instead of update, I had to explicitly set the model’s id to ‘null’.

CakePHP $useDbConfig not working?

Posted by on February 13, 2009

For about a half hour i wrestled with a model’s $useDbConfig variable not working in a CakePHP project.

The answer came buried in the comments of the cakebook: the database connection has to have ‘persistent’ set to ‘false’ in order to work!