Wednesday, March 1, 2017

How can I check the query selected nothing?

I use Laravel framework.

Here is my query:

$users = DB::table('users')->whereIn('id', [1, 2, 3])->get();

I need to check is there any result or not? In other word I need to check has any row selected or not? How can I check it?




via stack

Advertisement