我在我的php代码中执行以下操作:
$q="SELECT * FROM {$table} where x;
$link = mysqli_connect("localhost", "test", "test","mytable");
$res = mysqli_query($link,$q);
if($res)
{
$row = mysqli_fetch_assoc($res);
header("Content-type: text/xml");
header("Content-Disposition: attachment; filename=$name");
echo $row['blob'];
}
我看到我上传到mysql的数据(xml文件)没有任何前导空格,但当我运行上面的代码时,会出现3个新行和一个空格,并且该文件不再是格式良好的xml。有什么想法为什么无法从表中读取确切内容?