迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
开发怎么读取一个表所有数据
$sql = "SELECT `id`,`content` FROM `dr_1_news_data_0`";
$data = $this -> db -> query($sql);
while ($r = mysql_fetch_array($data)) {
echo $r['id'];
echo $r['content'];
}
怎么不好使啊
$sql = "SELECT `id`,`content` FROM `dr_1_news_data_0`"; $data = $this->db->query($sql)->result_array(); foreach ($data as $r) { echo $r['id']; echo $r['content']; }
$data = $this->db->get('1_news_data_0')->result_array(); foreach ($data as $r) { echo $r['id']; echo $r['content']; }