John Davidson

Display large data in chunks - PHP

0 comments
Message:


I have a query to pull data in chunk using limit of 5000. The total number of data in the database is 20,000. My file below has been set as a supervisor script so it keeps running.


The query below only picks 5000 data every time it runs but is there a way i can let the data pick all the 20,000 data but it limit of 5000 ?


file.php


$sql = "select * from `table` where status='0' and flop='1' and switch='0' LIMIT 5000";


My Answer:
"SELECT * FROM table_name LIMIT 5000 OFFSET $offset";

Rate this post

5 of 5 based on 3337 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us