Help get from view Update multiple row

in controllers

foreach ($_POST['check'] as $value) 

{

code get post update....

}

Help me ! Thanks



3.0k

Post your solution then, you know, to help others and to prevent another 979 case later.

>Done



564

Ok, This is my solution

                foreach ($this->request->getPost('check') as $value) 
                  {
                        if(is_numeric($this->request->getPost()['quantity'][$value]))
                        {
                              $valueupdate = $this->request->getPost()['quantity'][$value];
                              $updatelist = Mytable::findFirstById($value);
                              if($updatelist)
                              {
                                  $updatelist->assign(['quantity' => $valueupdate]);
                                  if($updatelist->save())
                                  {
                                    // Complete
                                    return $this->response->redirect('/'); 
                                  } 
                              }
                        }      
                  }

It was working