Possible Duplicate:
What is the difference between save and saveAll function in cakephp?
66 if (!empty($this->data)) {
67 $count = 1;
68 foreach($this->data['Images'] as $entry){
69 $file_name = "file" . $count;
70 if ($data_s = $this->Uploader->upload($file_name)) {
71 $this->Image->saveAll($data_s);
72 }
73 $count++;
74 }
75
76 }
$data_s is an array of different info and each time I would use save() but it would only save 1 array from that whole foreach loop in the database. When I have used saveAll(), it saved all the entries from all the arrays.
I am kind of confused about the difference between save() and saveAll() and why it works that way?
First of all, please read the manual.
savesaves one record andsaveAllsaves either many records or the primary record and all associated records, depending on the data you give it. Also heed this notice from before-linked manual: