webdevask.com

Menu

  • Home
  • New
  • Add question

php - I am facing issue while updating the data into table in Yii2

View Original

one text

Solution:

The link() method of yii\db\ActiveRecord is expecting the relation to use primary key. By default the frameworks finds the primary key from db schema but your tables doesn't have any primary keys.

You can try to override method in your model to make framework use columns with unique index as primary key instead of looking for them in db schema.

In your model class

public static function primaryKey()
{
    return ['id', 'consumer_id'];
}

Source

See also:

  • php สร้าง Google ชีตจากบัญชีบริการ

  • php - Laravel 8.0 Installation Failed

  • javascript - How to include HTML data (tags) as value in "arrayToDataTable" of Google Pie Chart?

  • how to Grouping array in php

  • php - vender folder from my laravel project has more 1k error

© 2021
E-mail: contact@webdevask.com
Back to top