php - Does DB::raw affect when uploaded on server? -


currently using code fetch data on mysql , working on localhost when uploaded on our aws server stop sorting?

$raw = "( 3959 * acos( cos( radians('$lat') ) * cos( radians( '$lat' ) ) * cos( radians( longitude ) - radians('$lon') ) + sin( radians('$lat') ) * sin( radians( latitude ) ) ) ) distance"; $stores = db::table('stores')     ->select('storename', 'id', 'photo', 'address', db::raw($raw))     ->orderby('distance')     ->where('domain', $domain->appenv)     ->take(25)     ->get(); 

is there being affected when uploaded on aws?

note our db on different server rds

you should set data binding variables passed query.

->setbindings([$lat,....]) ->get(); 

in query shold replace these variables ? , add these variables setbinding array in order use.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -