I have this code to fetch all data from database
while($row = mysqli_fetch_array($query)){
$therow1 = $row['r1'];
$therow2 = $row['r2'];
$therow3 = $row['r3'];//get
$therow4 = $row['r4'];//get
}
How can I get the $therow3
and $therow3
as an array then pass it on javascript as array.
The expected output in javascript array would be: $the_array
[
[-33.890542, 151.274856],
[-33.923036, 151.259052],
[-34.028249, 151.157507],
[-33.80010128657071, 151.28747820854187],
[-33.950198, 151.259302]
];
Then I will use this array in javascript
<script type="text/javascript">
var locations = $the_array;
</script>