If you are doing all of this in your prompt model, you dont need to
specify $this->Prompt.
Try this:
if(!empty($this->data)){
$this->create();
if($this->save($this->data)){
return true;
}else{
return false;
}
}
On May 1, 9:23 am, Dovdimus Prime <[EMAIL PROTECTED]> wrote:
> Hi there
>
> I'm having difficulty inserting a new record. Documentation is pretty
> thin on the ground.
>
> My 'prompts' table has an autogenerated id, and a content field.
>
> In the Prompt controller I am making the following call to the Prompt
> model:
>
> $this->Prompt->id = null;
> $this->Prompt->save(array('Prompt' => array('content' => 'Something
> here')));
>
> My understanding is that if no id is supplied, Cake will automatically
> insert rather than update.
>
> I'm not sure if the first line ($this->Prompt->id = null;) is even
> necessary, since the following line supplies an array with no id
> anyway.
>
> The code is not inserting a record. It's not erroring, it's not doing
> anything at all. I have tested that the code block it is in is being
> executed.
>
> Can anyone make any suggestions?
>
> Thanks
>
> David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---