所以我将一些XML存储在一个表中,然后使用MySQL' COMPRESS'功能如下:
$query = "SELECT UNCOMPRESS(table_row) FROM database WHERE this = 'that'";
$mysqli = $this->ConnectDB();
$result = $mysqli->query($query);
$task_result = $task->fetch_assoc();
这当然有效,但它会将返回的关联数组中的键重命名为'table_row'
到'UNCOMPRESS(table_row)'
。
有没有办法阻止这种重命名?
答案 0 :(得分:2)
$query = "SELECT UNCOMPRESS(table_row) AS table_row
FROM database WHERE this = 'that'";