Digital.Nova
11-06-2003, 01:10 PM
Hi, i have seen many tutorials on how to get next/prev links with mysql databases, but how do you do that with a flatfile database? I assume you would put each line in a numbered array, and somehow only display the right numbers, but, how would you do that?
Burhan
11-06-2003, 05:59 PM
The file (http://www.php.net/file) function returns the file as an array.
Then you simply step through the array in the increments that you want (from there on, the many mysql pagination tutorials will help). Just remember that instead of the LIMIT clause, you will have to worry about the array index.
So say the file has 20 lines, and you want to step by 5.
So the first time around, you will display the array from index 0 till 4 (that's 5 values), then upon refresh, increment your starting point (0).
Hope this helps.