$sql = "SELECT * FROM subcategories ORDER BY id ASC LIMIT ?????

Records=10,000

How i control this query with loop structure for example when we call it first time then first 100 call next time...