I am getting the values from database in php and encoded the retrieved values to json data format.
php code:
<?php
require_once('config.php');
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT * FROM theater';
mysql_select_db($dbname);
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_assoc($retval))
{
echo json_encode($row) "\r\n";
}
mysql_close($conn);
?>
output:
{"id":"11","region":"Central","cord_latitude":"12.9237","cord_longitude":"77.5535"}
now i need to get only some values from the json data to javascript. I need only cord_latitude and cord_longitude values in javascript how can i get those values in javascript?