SELECT *
FROM users
WHERE planet = 'earth'
AND (fname LIKE '%hawk%' OR lname LIKE '%hawk%')
AND state = 'FL'
ELOQUENT SQL:
$name = "hawk";
$usersResults = DB::table('users')
->where('planet', '=', 'earth')
->where(function($query) use ($name){
$query->where('fname' , 'like', '%'.$name.'%');
$query->orWhere('lname' , 'like', '%'.$name.'%');
})
->where('state', '=', 'FL')
->get();
Thanks for the info !
ReplyDeletethanks a lot..your code working properly
ReplyDelete