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

Hi!
I have a table with two primary keys, but no foreign keys and the table update is showing an error depending on the configuration of "protected $primaryKey".
If I remove "protected $primaryKey" it displays an error message but updates {else} it displays an error message and does not update.

Is it valid or possible to inform both primary keys?

Model:
Code:
<? php namespace App \ Models;

// 20200512

use CodeIgniter \ Model;

class PlayersAlbumsModel extends Model
{
     protected $table = 'players_albums';
     protected $primaryKey = 'player_id';    
    
     protected $TimeStamps = false;
     protected $useSoftDeletes = false;
     protected $allowedFields = ['player_id', 'album_id', 'pick'];

}


Pleas, any suggestion?
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB