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

CI框架代码变换

WBOY
WBOYOriginal
2016-06-13 11:58:371035browse

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 />

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

Statement:
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