こんにちは、こんにちは。私はで新しいです.PPとLaravel。 laravelで結合クエリを使用したいと思っていますが、以下のコードを書いていますが、エラーが表示されます。Laravel Join query
$data = DB::table('employees')
->join('contact_details', 'employees.id', '=','contact_details.employee_id')
->join('education', 'employees.id', '=', 'education.employee_id')
->join('addresses', 'employees.id', '=', 'addresses.employee_id')
->select('employees.first_name','employees.id','employees.gender','education.id','education.school','education.subject','addresses.village')
->where('employees.id', '=',$id)
->get();
return "$data";
とエラーが
ErrorException in ProfileController.php line 66:
Array to string conversion
in ProfileController.php line 66
at HandleExceptions->handleError('8', 'Array to string conversion', 'E:\xampp\htdocs\djiafg\app\Http\Controllers\ProfileController.php', '66', array('id' => '72', 'data' => array())) in ProfileController.php line 66
at ProfileController->view('72')
at call_user_func_array(array(object(ProfileController), 'view'), array('id' => '72')) in Controller.php line 80
at Controller->callAction('view', array('id' => '72')) in ControllerDispatcher.php line 146
at ControllerDispatcher->call(object(ProfileController), object(Route), 'view') in ControllerDispatcher.php line 94
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
の質問にと'($ ID) 'すなわち'から、余分なparanthesisを削除:
はでより多くを参照してください。 –
@ Nazir Noori:$ idはカッコで囲まれているようですが、エラー報告が実際の状況をはっきりと示すかもしれません。 – naf4me
エラーを送信しないでください。それは簡単すぎるでしょう。 – Strawberry