I need a solution to paginate my csv file output when viewing on the web. The csv file will become quite large and I'd like to split it to 20 entries per page with links to the next or previous pages.
I already have the following script to show the results which is working fine, just need a little polishing for pagination and including the column titles on each page. Of course it's enclosed in the php statement...
$dir_name = "C:/wamp/logs/ocwa.csv";
$fh = fopen($dir_name, "r");
$row = 1;
echo "<table width=\"100%\" border=\"1\">\n";
while(($data = fgetcsv($fh, 1000, ",")) !== FALSE)
$num = count($data); // count the # of lines that exist
$row++; //increment the row variable to the next line
//output current line to the screen.
for ($i=0; $i < $num; $i++)
//close file handler and delete file
Hope someone can help with a piece of code example.