how do i add a where clause on these query given by google...i want to put on the where clause.. where profileStatus = PUBLIC..
$results = DB::select
(DB::raw
('SELECT *,
( 6371 * acos( cos( radians(' . $lat . ') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(' . $lng . ') ) + sin( radians(' . $lat .') ) * sin( radians(lat) ) ) ) AS
distance
FROM users
HAVING distance < ' . $distance
)
);
'SELECT *, ( 6371 * acos( cos( radians(' . $lat . ') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(' . $lng . ') ) + sin( radians(' . $lat .') ) * sin( radians(lat) ) ) ) AS distance FROM users WHERE profileStatus LIKE 'PUBLIC' HAVING distance < ' . $distance
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community