Selecting all records using SQL LIMIT and OFFSET query

后端 未结 7 595
一向
一向 2020-12-08 20:09

I wonder if there is a way to accomplish:

SELECT * FROM table

by using LIMIT and OFFSET like so:

         


        
7条回答
  •  不知归路
    2020-12-08 20:16

    As the record will grow up, use mysql_num_rows to dynamically find total amount of records, instead of using some large number.

    $cektotalrec=mysql_query("SELECT * FROM TABLE");
    $numoffset=mysql_num_rows($cektotalrec); 
    $numlimit="0";
    

    then:

    $final="SELECT * FROM table ".$numlimit.", ".$numoffset"";
    

提交回复
热议问题