我可以从MySQL数据库中获取字符数据,如下图所示,但是当我从数据库中获取BLOB图像时,它显示空值。
你可以帮助我解决这个问题,通过PHP从MySQL获取图像到使用Volley的ANDROID并在IMAGEVIEW中显示它
PHP
session_start();
define('DB_USER','********');
define('DB_PASSWORD','********');
define('DB_HOST','*******');
define('DB_NAME','*********');
$dbc=@mysql_connect(DB_HOST,DB_USER,DB_PASSWORD)or die(mysql_error());
//echo "database";
mysql_select_db(DB_NAME)or die(mysql_error());
$result=mysql_query("SELECT * FROM disco_detail");
while($row=mysql_fetch_assoc($result))
{
$output[]=$row;
}
print(json_encode($output));
输出
[{" disco_name":"摩卡咖啡&对话"," disco_address":" 28A,防御殖民地市场,新德里"," disco_phone":" 0",&# 34; disco_offer":" 30%的饮料"," disco_city":"新德里","纬度":&# 34; 28.531256""经度":" 77.146764"" disco_image":空},{" disco_name":& #34; Capitol"," disco_address":" 50-B,Ashok Hotel,Niti Marg,Chanakyapuri,New Delhi"," disco_phone":&# 34; 0"," disco_offer":" 10%的食品折扣"," disco_city":"新德里",&# 34;纬度":" 28.597192""经度":" 77"" disco_image":空},{&# 34; disco_name":" Kota House"," disco_address":" Shahjahan Road,Khan Market,Lodhi Estate,New Delhi"," disco_phone& #34;:" 0"," disco_offer":"免费参赛"," disco_city":"新德里" "纬度":" 29""经度":" 77""盘o_image":null},{" disco_name":" Etal"," disco_address":" Level-II,MGF City Square Mall,Rajouri Garden,New Delhi"," disco_phone":" 0"," disco_offer":" Bar"&#3折5% 34; disco_city":"新德里","纬度":" 29","经度":" 77&# 34;," disco_image":""},{" disco_name":"水烟"" disco_address&#34 ;: " Basant Block,Vasant Vihar,新德里"" disco_phone":" 0"," disco_offer":" 20%折扣在Hookah"," disco_city":"新德里","纬度":" 29","经度&#34 ;:" 77"" disco_image":""},{" disco_name":" DISCOTHEQUE",& #34; disco_address":" Ranjit Avenue,Amritsar"," disco_phone":" 0"," disco_offer":&#34 ;免费参赛"," disco_city":" Amritsar","纬度":" 0","经度&#34 ;:" 0"" disco_imag e":""},{" disco_name":" Kcet"," disco_address":" Ranjit Avenue, Amritsar"," disco_phone":" 999999974"," disco_offer":" 750/750项目中的标记"," disco_city":"阿姆利则""纬度":" 0""经度":" 0&#34 ;, " disco_image":""}]