我有这个查询:
$query = 'SELECT `trades`.`id` AS `trade.id` FROM `trades` WHERE `id` = '. $this->trade->id . ' ORDER BY `created_at` DESC LIMIT 1';
(当然)输出哪个
array(1) {
["trade.id"]=>
string(2) "44"
}
如何获取它以代替输出?
array(1) {
["trade"]=> array(1) {
["id"]=> string(2) "44"
}
}
答案 0 :(得分:0)
$query = 'SELECT `trades`.`id` AS `id` FROM `trades` WHERE `id` = '. $this->trade->id . ' ORDER BY `created_at` DESC LIMIT 1';
$arr['trade']=$query;
print_r($arr);
检查它。我希望工作.....