How to output part of feild using mysql
Hi all. i got a huge list of mp3 that they are in diffrent folders. I put all the songs infor in mysql database in a table called files. I want a query db that output foldernames for me .The folder name is part of feiled called filename in files table. The value of filename is like this stored in db :
where the bold part is the foldername. i want to print folder name.Note:mp3s is the root folder for mp3s.The whole point is to list all folders name and link to page that holds songs inside those folders.
Furthermore, i want a query all feilds info for songs in each given folder.What i mean is that for each folder it lists all songs info iside that folder.I want to be able to tell the query what folder i want to list its song.Thanks
I cannot visualize a reasonable way to do this via SQL. (I'm not saying there is NO way to do, but I don't see it.) If I were doing it I would re-design the data table to keep the file path and and file name in separate fields. Then I'd write a PHP or Perl script to extract the current data, parse it using a regexp function, then re-insert it into the database.
Many thanks for u reply. well these are the fields in table :
Originally Posted by NogDog
I already have a query that list songs by album .I have huge list of mp3 in diffrent folders some of them are collections from diffrent artis and albums and some does not have good tags so i want create seperate page using a query that list folders for me and then link that page to another page that lists songs inside that folder.
I use this getid3 php script that uploads for me song info to above db.That script does not put the foldernames as seperate field and it is huge program and hard to edit. I be happy if i find a way to over come problem or is there any php prog that stores folder names to current db since i easily can use one of empty fields for it ?Thanks
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)