I have lerant about android
and MySQL
, and I have view about this web:http://codeoncloud.blogspot.tw/2013/07/android-mysql-php-json-tutorial.html
but I don't know how to solve this problem: enter image description here
<?php
$host="sql113.byethost14.com"; //replace with database hostname
$username=" xxx "; //replace with database username
$password=" xxx "; //replace with database password
$db_name="b14_16972597_food"; //replace with database name
$con=mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql = "select * from emp_info";
$result = mysql_query($sql);
$json = array();
if(mysql_num_rows($result)){
while($row=mysql_fetch_assoc($result)){
$json['emp_info'][]=$row;
}
}
mysql_close($con);
echo json_encode($json);
?>