base64在PHP中编码MySQL blob,而不分解数据
是否可以获取包含blob的MySQL行,并在所有blob都通过base64在PHP中编码MySQL blob,而不分解数据,php,mysql,Php,Mysql,是否可以获取包含blob的MySQL行,并在所有blob都通过base64\u encode运行时返回该行,而不必首先分解获取结果 范例 $res = $this->stmt->fetchAll(PDO::FETCH_ASSOC); $resArray = array(); $resCount = 0; if ($this->stmt->rowCount() > 0){ foreach($res as $row){ $columnCount
base64\u encode
运行时返回该行,而不必首先分解获取结果
范例
$res = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
$resArray = array();
$resCount = 0;
if ($this->stmt->rowCount() > 0){
foreach($res as $row){
$columnCount = 0;
foreach ($row as $key => $val) {
$columns = $this->stmt->getColumnMeta($columnCount);
if(isset($columns['native_type'])){
$columns['type'] == 'blob') {
$val = base64_encode($val);
}
}
$columnCount++;
$resArray[$resCount][$key] = $val;
}
$resCount++;
}
}
return $resArray;
}您可以在查询库中使用。不幸的是,在5.5你可以在你的查询库中使用。不幸的是,5点5分