I want to get the data in the mysql database and output them in each case as in the database. But when I display them, just see the word "Vi tri cua nguoi dung: Array" without seeing the data. i test by use JSON, I get the result on the screen is:
"[{" Kinhdo ":" 106.71246126888674 "," Vido ":" 10.78865449101134 "}]"
Can you help me?
<?php
mysql_connect("xxxx","xxx","xxx");
mysql_select_db("a4602996_lv");
$query_insert="select Kinhdo,Vido from VietMap where id = (select max(id) from VietMap)";
$sql = mysql_query($query_insert);
if(mysql_num_rows($sql)){
while($row=mysql_fetch_assoc($sql)){
$json[] = $row;
}
}
//print(json_encode($json).'<br/>');
print 'Vi tri cua nguoi dung: '.$json['Kinhdo'];
mysql_close();
?>
use this :
and you shold provide offset to $json array like :