Page 1 of 1

filtering, limiting and paginating CSV results

Posted: Fri Feb 22, 2008 4:48 am
by kevrelland
I currently putting together a site and the data is stored in a csv file.

Can anyone give me some direction on how to limit the array that i have already got, thats working, to a specified number of records and add in the the pages for the other results.
I also want to be able to filter the results to show for example all the people with the name kevin, with a drop down menu, containing all the names of everyone in the csv.

i have loads of searches and all i can find is how to import into a mysql db or just show all the data in one go and i just don't know where to start looking

cheers
kev

Re: filtering, limiting and paginating CSV results

Posted: Fri Feb 22, 2008 9:51 am
by pickle
There's no real way to paginate the data in a CSV without loading it all up. You would REALLY benefit from storing that data in a database, as you can do a few simple queries to get your pagination & your search.

What is the array you've already got? Does it contain all the CSV data? Other data the CSV data is to be appended to?

Re: filtering, limiting and paginating CSV results

Posted: Fri Feb 22, 2008 10:26 am
by anjanesh
kevrelland wrote:i have loads of searches and all i can find is how to import into a mysql db or just show all the data in one go and i just don't know where to start looking
Look into MySQL's CSV storage engine.
You get to store data in CSV format and mysql can handle your SQL statements at the same time.