<?php
$query = mysqli_query($connection, "SELECT address1, address2, parish FROM `contestantsaddress`");
//Starts while loop so all addresses for the given information will be populated.
$addresses = array();
while($result = mysqli_fetch_array($query)) //instantiates array
{
$address1 = $result['address1'];
$address2 = $result['address2'];
$parish = $result['parish'];
//$country = $result['country'];
array_push($addresses1,$address1, $address2, $parish, $country);
$count++;
} //ends while
?>
for(var i=0; i<10; i++){
var addresses = [<?php echo $addresses; ?>];
}
//I would want the above addresses to be populated in the array just as the one below so I can geocode them. The problem is I try to achieve this using php to push them in the array to have them as the one below but I can't seem to get it working. I am using php and javascript to achieve this.
// ======= An array of locations that we want to Geocode ========
var addresses = [
'251 Pantigo Road Hampton Bays NY 11946',
'Amagensett Quiogue NY 11978',
'789 Main Street Hampton Bays NY 11946',
'30 Abrahams Path Hampton Bays NY 11946',
'3 Winnebogue Ln Westhampton NY 11977',
'44 White Oak Lane Montauk NY 11954',
'107 stoney hill road Bridgehampton NY 11932',
'250 Pantigo Rd Hampton Bays NY 11946',
'250 Pantigo Rd Hampton Bays NY 11946',
'44 Woodruff Lane Wainscott NY 11975',
'Address East Hampton NY 11937',
'Address Amagansett NY 11930',
'Address Remsenburg NY 11960 ',
'Address Westhampton NY 11977',
'prop address Westhampton Dunes NY 11978',
'prop address East Hampton NY 11937',
'Address East Hampton NY 11937',
'Address Southampton NY 11968',
'Address Bridgehampton NY 11932',
'Address Sagaponack NY 11962',
"A totally bogus address"
];