Fellow Coders,
I have made database and table relations in my phpMyAdmin. What I have to do is to get the id of the project, portrayed as the name of the company linked to the project_id. And the subproject_id, portrayed as title...
I have to get all of these from the database, and I have to get those values in a dropdown menu.. Something like (project_id portrayed as company-name --- subproject_id as subproject_title)
I am in quitte the pickle... What I have to do is make an eloquent query that gets the values from the relative database using inner join? Or as far as my understanding goes. the print screens of the table values will be posten below, and also my pre-made query
And here my inner join query (note that I have never used inner join before)..
$values = DB::table('hour_registrations')->join('projects', 'id', '=', 'id')->join('subprojects','id', '=', 'id')->select('projects.*', 'id', 'subprojects.id')->get();
I think I have the beginning right, but I literally have 0 clue as to what I need to select and get from the tables... Thanks for helping in advance I really appreciate everyone that takes a look at this
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire