Home > Backend Development > PHP Tutorial > CI框架代码变换

CI框架代码变换

WBOY
Release: 2016-06-13 11:58:37
Original
1036 people have browsed it

CI框架代码转换

<br />$array = array();<br />while($row = mysql_fetch_array($result,MYSQL_ASSOC)){<br />    $key = date('Y年m月d日',$row['time']);<br />    $array[$key][]=$row;<br />}<br />
Copy after login

请问这段代码怎么转为CI框架的?
------解决方案--------------------
$array = array();
$query = $this->db->query("要执行的 SQL");
foreach ($query->result_array() as $row)
    $key = date('Y年m月d日',$row['time']);
    $array[$key][]=$row;
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template