Jump to content

looping arraylist


rishe

Recommended Posts

hi all,

i am fetching the data from database in array as

 

Array ( [0] => Array ( [latitude] => 3397019 [longitude] => 8541652 )
[1] => Array ( [latitude] => 3497019 [longitude] => 8641652 )
[2] => Array ( [latitude] => 3597019 [longitude] => 8741652 ) )
now how to convert the above as
Array ( [0] =>3397019, 8541652 )
[1] =>3497019,8641652 )
[2] => 3597019, 8741652 ) )
my code for fetching the records is
$sql = "SELECT * FROM atm ";
$array = array();
$result = mysql_query($sql);
if (! $result){
throw new My_Db_Exception('Database error: ' . mysql_error());
}
while($row = mysql_fetch_assoc($result)){
$latlon[] = $row;
}

print_r($latlon);

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...