function updatePosition() { $positionList = $this->input->post('positionList'); $idList = $this->input->post('idList'); $estateareas = new Estatearea(); for ($i = 0; $i < count($idList); $i++) { $estateareas->where("id", $idList[$i]); $estateareas->get(); $estateareas->position = $positionList[$i]; $estateareas->save(); $estateareas->clear(); } redirect("admin/estateareas/list_all"); }