I've been going crazy on how to figure this out. Kinda new to php. I'm trying to get array results outside of a while loop. Im basically trying to put my results into an array and then set those array values as a variable to use outside of while loop. Im trying to load addresses into a jquery plugin that plots multiple points. I wanted to get the addresses from DB then store in variable with the addresses and use that variable in my javascript.
$sql = "SELECT zip, state, city FROM $tbl_name WHERE state = 'value';
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$zip = $row->zip;
$state = $row->state;
$city = $row->city;
$newzip= $row['zip'];
$addresses = array(
array("address"=>$newzip),
);
}
echo $addresses; <---would like to do something like that with all the values put in $addresses the array