0
I am running the following SQL
:
select * from `table` where `fields` = PointFromText("POINT(-23.559762 -46.699425)")
When executed directly by the bank returns the id
expected to be executed by Laravel
to SQL
returns
[]
Code in the Laravel
.
$data=Model::whereRaw('field=PointFromText("POINT(?)")',['-23.559762 -46.699425'])->get();
What’s wrong with the code above to return []
instead of id
expected?
Exchange whereRaw for Where and use DB::raw("Pointfromtext(-23.559762 -46.699425)")
– Lucas Antonio
is because of the quotation marks
['-23.559762 -46.699425']
!!! among the numbers.– novic
I’ve tried without the quotes );
– B. A.
@B.A makes a Model::all() and puts it on dd for me to see something
– Lucas Antonio