Reputation: 3074
I want to update the following data:
Array
(
[Reseller] => Array
(
[id] => 1
[name] => Abdus Sattar Bhuiyan
[mobile] => 01673050495
[email] => [email protected]
)
)
keeping unchanged others. So How can I do this. I try with saveField. It works for only one field updating at a time.
N.B: I am using cakephp 2.9
Upvotes: 0
Views: 58
Reputation: 1280
Try this
$data['id'] = 1;
$data['name'] = 'Abdus Sattar Bhuiyan';
$data['mobile'] = '01673050495';
$data['email'] = '[email protected]';
$this->Reseller->save($data,false);
Never forget to put the field id
for which you are updating the record.
Upvotes: 1