|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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 :
http://localhost/wimpy5recursive/mp3s/album1/song1.mp3 http://localhost/wimpy5recursive/mp3s/album2/song4.mp3 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 |
|
#2
|
||||
|
||||
|
Are you storing the URL itself in the database?
You might want to consider storing the album and filename as two different fields, then truncate the values. I have no faith in this code working, I suggest you take my first suggestion =) Code:
SELECT SUBSTR(SUBSTR(filename,INSTR(filename,'/',1,5)), INSTR(filename, '/')) AS folder FROM files ORDER BY folder;
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
|||
|
|||
|
Quote:
Many thanks for u reply. well these are the fields in table : Code:
filename|artist|album|title|track|comments|genre|s econds|filesize|bitrate 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. Unfortunetly it give me the following error trying your code ; Code:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1,5)), INSTR(filename, '/')) AS folder FROM files ORDER BY folder LIMIT 0, 30' at line 1 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > How to output part of feild using mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|