Hi there, I have a simple script that that writes to a flat txt database, with entry#|name|email ... like this:
3|bob|bob@blah.com
2|john|john@domain.com
1|kathy|kath@whatever.com
If I have a txt file with 50 lines, how can I display the contents into pages of 10 entries? Like: "results 1-10 of 50, next page"... With the pages using a query like display.php?page=2
Any help is greatly appreciated.
Break up flat file contents into pages?
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
arborint told you: (start=(page-1)*page_size)
Or if you prefer:
Or if you prefer:
Code: Select all
$start = $records_per_page * ($page_num - 1);