Welcome Guest, Not a member yet? Register   Sign In
table with 2 primary keys update problem
#2

Update:
When "$model->save" is used the problem occurs exactly as described above; if the option is $model->insert with or without the primary key, the error message occurs but the table is updated.

Controller:
Code:
public function artrec() {

        helper('form');

        $model = new PlayersAlbumsModel();

        $header = array (
            'icon' => 'codeigniter',
            'css' => '',           
            'title' => 'Atualização da tabela \'player_albuns\' - wdeda',
            'action' => '/ci4/search/allmedia/',
            'placeholder' => 'Pesquisar'
        );

        $rules = [
            'player_id'  => 'required',
            'album_id'  => 'required'
        ];

      if ($this->validate($rules)) {
          $model->insert([
              'player_id'  => $this->request->getVar('player_id'),
              'album_id'  => $this->request->getVar('album_id'),
              'pick'      => $this->request->getVar('pick')                   
          ]);
     

        echo view('templates/headerx', $header);
        echo view('utils/artec');
        echo view('templates/footerfb');

    } else {

        echo view('templates/headerx', $header);
        echo view('utils/artrec');
        echo view('templates/footerfb');
    }
    }


Attached Files
.pdf   insert with pkey off - update done.pdf (Size: 107.63 KB / Downloads: 3)
.pdf   insert with pkey on - update done.pdf (Size: 107.79 KB / Downloads: 2)
Reply


Messages In This Thread
RE: table with 2 primary keys update problem - by wdeda - 05-12-2020, 04:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB