简体   繁体   中英

jQuery PHP Oracle Scroll to bottom load data

I'm using jQuery scroll bottom to load data getting from PHP + Oracle.

I tried to googling it but only show result for MySQL

//MySQL
$limitStart = $_POST['limitStart'];
$limitCount = 6;

$query = "SELECT id, name FROM countries ORDER BY name limit $limitStart, $limitCount";

Now I want it query using ORACLE query

$query = "SELECT id, name FROM countries ORDER BY name WHERE ROWNUM <= '$limitCount';

How to do that? to set the $limitstart?

Thanks

Try this,

$query = "SELECT id, name FROM countries ORDER BY name
          OFFSET $limitStart ROWS FETCH NEXT $limitCount ROWS ONLY";

Refer http://docs.oracle.com/database/121/SQLRF/statements_10002.htm#BABBADDD and https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM