mysql 实现同一个sql查询 分页数据 和总记录数

$get_sql = "SELECT
                            sql_calc_found_rows    field1,field2
                        FROM
                            table 
                        WHERE
                            name = '1' order by add_time desc limit 2,20 ";

$get_total_sql = "SELECT FOUND_ROWS() as total";

  

 

如果本文章已帮助到您!

posted @ 2019-12-03 16:34  撑一支船蒿  阅读(1900)  评论(0编辑  收藏  举报