I have 4 records on my guests database.
I'm trying to query to the guest that has note_display = 1
and have the highest id.
I've tried
$last_note = DB::table('guests')->where('note_display','=',1)->where('id', DB::raw("(select max(`id`) from guests)"))->first();
I got
Trying to get property of non-object
I'm a lil stuck now, any hints will be a huge helps ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire