Skip to content
Advertisement

Arrange values in array php / mysql

I am exporting data from mysqli to google firebase DB. In firebase table one of the column named siteGeoCode (latitude and longitude) having values like [17.426083,78.439241] in array format. But in mysqli table two separate columns are there for latitude and longitude. I am trying to fetch records like below and converting those to array format.

JavaScript

// output

JavaScript

but my desired output should be like below

JavaScript

Advertisement

Answer

If you are wanting to place the result of the latitude/longitude columns into the result grouped, do the manipulations to the row, then add it to your result set, abit like below.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement