我想解码MySQL数据表中的blob值,并在php中通过json返回 为什么json是空的?
$sth->execute($_REQUEST);
$row = $sth->fetch(PDO::FETCH_ASSOC);
$result = $sth->fetchAll();
if(count($result) > 0)
{
$rows = array();
foreach($result as $r)
{
$rows[] = $r;
}
foreach($rows as $key=>$value)
{
$newArrData[$key] = $rows[$key];
$newArrData[$key]['Data'] =base64_encode($rows[$key]['Data']);
}
header('Content-type: application/json');
echo json_encode($newArrData);
}