I have to show some data in my android application from a external database including an image. I have successfully got text data from the database. Here is my php code. Now I need to get blob data. How can I achieve this..?
$id=$_POST['ID'];
$db_server = mysql_connect($hostname,$username,$password);
if (!$db_server) die("Unable to connect to MySQL: " . mysql_error());
mysql_select_db($database,$db_server);
$result=mysql_query("select * from names where ID=$id");
while($row=mysql_fetch_assoc($result)){
$output[]=$row;
}
print(json_encode($output));
mysql_close($db_server);
?>