PLEASE HELP ME!
I have an application that needs to get the users details e.g) first name from the database, however for each user i want to join the university they choose when registering and check if that university's ID matches against another external ID. When true return 1 or 0 when false. I tried coming up with a solution buts i get errors.
My Query so far:
DB::table('users')->select('users.first_name', 'universities.name', 'universities.state')
->where('users.id', '!=', Auth::user()->id)
->join('universities', function ($join) {
$join->on('users.university_id', '=', 'universities.id')
->select(DB::raw('count(universities.id) as state'))
->where('universities.id', '=', '$theExternalID')
->groupBy('users.university_id');
})
->get();
The query above still causes errors. Please help!
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2yha69m
via IFTTT
Aucun commentaire:
Enregistrer un commentaire