CI框架代码变换
时间:2021-07-01 10:21:17
帮助过:5人阅读
CI框架代码转换
$array = array();
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
$key = date('Y年m月d日',$row['time']);
$array[$key][]=$row;
}
请问这段代码怎么转为CI框架的?
------解决方案--------------------$array = array();
$query = $this->db->query("要执行的 SQL");
foreach ($query->result_array() as $row)
$key = date('Y年m月d日',$row['time']);
$array[$key][]=$row;
}