Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying csv data with sort options

Status
Not open for further replies.

mikedaruke

Technical User
Mar 14, 2005
199
US
All, I have a CSV file that gets changed everynight.

I want to display it on a webpage, and be able to sort the columns which are of type date, string, and interger.

Is there any easy datagrid class or something I can use, or do I have to code this whole thing? I see so many widgets where you run the mouse over the row and it highlites it, sorts columns, etc. but they seem to be for like asp or java.

Any help on the php side?
 
No real Datagrid thingies i know off.

But its a very simple task if you place your CSV file contents into an array. You can then sort the array by whichever column you wish and display it.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
There's a few examples in the PHP manual entry for the [blue]sort()[/blue] function.

One of the examples deals with dates.






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
unless you want to keep the data in its sorted form, i'd use something like a js table sorting script and deliver the table as a json object
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top