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
filtering, limiting and paginating CSV results
Moderator: General Moderators
-
kevrelland
- Forum Commoner
- Posts: 73
- Joined: Mon Jan 08, 2007 7:41 am
Re: filtering, limiting and paginating CSV results
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?
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?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: filtering, limiting and paginating CSV results
Look into MySQL's CSV storage engine.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
You get to store data in CSV format and mysql can handle your SQL statements at the same time.