Forum Moderators: coopster

Message Too Old, No Replies

Help finding a script

         

philcragg

5:44 pm on Jan 11, 2004 (gmt 0)

10+ Year Member



Hello, I have a list of midi files on a excel sheet. It has 5 columns with song name, file size, artist, Genre, and filename that i want linked to the midi etc. I need to be able to upload this to my site, with the following functions...
A search feature (ie type an artist name to bring up only the typed artist rows, or genre type to bring up say all the dance rows. I also want to be able to sort the columns alph/numeric by clicking the relevant heading. Is this impossible or will I need to enter all the details seperate into something new. I`m only new so be gentle.
EDIT// I have PHP, MYSQL, and use dreamweaver if this helps!

dmorison

7:44 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This would be quite easy to do if you can save and upload your spreadsheet not as an Excel document (.xls); but as a "comma separated values" file (.csv). You can do this from the "Save As..." menu in Excel.

Then, with the .csv file on your server, a search script would be simple.

As an example, suppose you just wanted the rows matching a certain artist. Create a form, and retrieve the variable $artist from your user.

Then, use fopen() to open the .csv file, and navigate the file using fgetcsv() [uk.php.net]. Use the example on that fgetcsv() to loop through each row of the file.

fgetcsv() returns an array for each line. Within each iteration of the loop compare $artist with the array entry corresponding to the artist column. If there is a match, output the results however you wish.

Sorry that's not a complete solution for you; but it should point you in the right direction.