yes just make sure your array is formatted to match your model.

$data = array('Model'=>array('field_one'=>'field_one_value',
'field_two'=>'field_two_value', ));

i like using pr($data) just to check out the formatting before going
live.
array(
[Model]
      array(
          [field_one] = field one value
          [field_two] = field two value
             )
)

if your data isn't formatted like this it wont save. and btw you
should do as @Miles J said and use $this->Model->save($data)
$this->controller->save() won't work (unless you created a function
called save in your controller for some odd reason [that function
would still need to use $this->Model->save()]).

sorry for all the verbosity




On Jul 28, 5:41 pm, Miles J <[email protected]> wrote:
> $data = array('columnName' => 'value');
>
> $this->Model->save($data);
>
> On Jul 28, 1:06 pm, RobS <[email protected]> wrote:
>
> > Ok so here's the scoop: I'm using a form to upload to a temp file that
> > gets parsed into an array. The array matches field for field the
> > database table it's going into.
>
> > How do I save to the database with this new array? I've tried all
> > sorts of $this->ControllerName->save() permutations and am coming up
> > dry. Any ideas?
>
> > Thanks,
> > Rob
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to