I am trying to add a marker to my gmaps.js map. The long. and lat. values are stored in a database, which I select using a PHP Script.
Once fetched, both of the long. and lat. values are stored in an array, under the variable $data.
I wanted to use json_encode($data); in order to pass the variables, however I would have had to change the header to a json application, I have already echoed some PHP onto the page, therefore this is unfeasable.
I have now tried echoing the json_encode into the jQuery function using an $.each loop, however it has been unsuccessful, as not every entry retrieved by the database will have a marker.
What is the best solution, to get an ID, long. and lat. value for max 10 records, pass this to a jQuery function to position on a map?