Cakephp – How to Update Table data in cakephp?

QuestionsCategory: CakephpCakephp – How to Update Table data in cakephp?
Roboto asked 3 weeks ago

In Cakephp, For Updating many option found.
But For me to Update the table Field iis working. If Any body has other answer please reply.

$this->MODELNAME->updateAll(array('active' => 0), array('id' => $id) );

devchandan Staff replied 3 weeks ago

Yes. Its Correct.

$this->MODELNAME->updateAll(array(‘active’ => 0), array(‘id’ => $id) );

/*
//—————————————————————
This is, SET = array(‘active’ => 0)
and
CONDITION = array(‘id’ => $id)
//—————————————————————
*/