Fellow Coders,
I'm trying to use an inner join query to get multiple data from my relative tables.. What i'm trying to do is to get the (project_id
as company_name
- subproject_id
as subproject_title
). I tried to use the query as I will state below. Also I will post printscreens of my tables.
$values = DB::table('hour_registrations')->join('projects', 'id', '=', 'id')->join('subprojects','id', '=', 'id')->select('projects.*', 'id', 'subprojects.id')->get();
I would love some help with my question as I do not understand what to do now..
I think this should do the trick (if I understood your table structure correctly).
I would encourage you to read the official Laravel documentation on Joins.