Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[42S22]: Column not found #113

Open
msgkuna opened this issue Mar 5, 2021 · 0 comments
Open

SQLSTATE[42S22]: Column not found #113

msgkuna opened this issue Mar 5, 2021 · 0 comments

Comments

@msgkuna
Copy link

msgkuna commented Mar 5, 2021

Hi,

I have table like this:

namespace Modules\Personalia\Entities\Referensi;
use Illuminate\Database\Eloquent\Model;
use Modules\Personalia\Entities\Referensi\Satker;

class Kecamatan extends Model
{
use \Awobaz\Compoships\Compoships;

protected $table = 'master_kecamatan';
protected $primaryKey = ['satker_id', 'keca_id'];
protected $keyType = 'string';
public $incrementing = false;
public $timestamps = false;

protected $guarded = [];

public function satker()
{
    return $this->belongsTo(Satker::class, 'satker_id', 'satker_id');
}

}

but I get error message like this:

Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'master_kecamatansatker_id' in 'where clause' (SQL: select * from master_kecamatan where ((master_kecamatansatker_id = 62060 and master_kecamatankeca_id = 010) or (master_kecamatansatker_id = 62060 and master_kecamatankeca_id = 011) or (master_kecamatansatker_id = 62060 and master_kecamatankeca_id = 020) or (master_kecamatansatker_id = 62060 and master_kecamatankeca_id = 030) or (master_kecamatansatker_id = 62060 and master_kecamatankeca_id = 031)))

I use Laravel 8.31.0 with PHP 7.4.15

What should I do? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant