美文网首页
thinkphp5.0.24--分页查询

thinkphp5.0.24--分页查询

作者: zlchen | 来源:发表于2020-07-04 23:09 被阅读0次
    LIMIT
    //SELECT * FROM newswhere is_delete=0 limit 0,10; $page为页码,$page_num为每页数量,limit(($page-1)*$page_num,$page_num)
    Db::table('news')->where(['is_delete' => 0])->limit(0,10)->select();
    
    PAGE
    //SELECT * FROM newsWHERE is_delete=0 limit 0,10;  page(页码,每页数量),第二页时,page(2,10)
    Db::table('news')->where(['is_delete' => 0])->page(1,10)->select();
    

    相关文章

      网友评论

          本文标题:thinkphp5.0.24--分页查询

          本文链接:https://www.haomeiwen.com/subject/qfzpqktx.html