Базовая таблица или представление не найдены: 1146 Таблица «doctor1.education» не существует (SQL: выберите * из «educat ⇐ Php
Базовая таблица или представление не найдены: 1146 Таблица «doctor1.education» не существует (SQL: выберите * из «educat
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'doctor1.education' doesn't exist (SQL: select * from education where education.dr_id in (1))
here i want to use hasMany for my foreign key in table educations,here doctor id is foreign key
Doctor Model Code for doctors table:-
public function educations(){ return $this->hasMany('App\Models\Education','dr_id'); } Education model for educations table:-
public function doctor(){ return $this->belongsTo('App\Models\Doctor','dr_id'); } Controller Code for this page:-
public function profilesetting(){ $userinfo = Doctor::with('educations')->where('id','=',session('drid'))->get(); dd($userinfo); } please tell me that how i solve this error?
Источник: https://stackoverflow.com/questions/725 ... -exist-sql
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'doctor1.education' doesn't exist (SQL: select * from education where education.dr_id in (1))
here i want to use hasMany for my foreign key in table educations,here doctor id is foreign key
Doctor Model Code for doctors table:-
public function educations(){ return $this->hasMany('App\Models\Education','dr_id'); } Education model for educations table:-
public function doctor(){ return $this->belongsTo('App\Models\Doctor','dr_id'); } Controller Code for this page:-
public function profilesetting(){ $userinfo = Doctor::with('educations')->where('id','=',session('drid'))->get(); dd($userinfo); } please tell me that how i solve this error?
Источник: https://stackoverflow.com/questions/725 ... -exist-sql
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение