Hi GuysI'm getting old and its hard to retain information so I need some back up. I think its beat if I explain fully what I'm trying to do it maybe a bit desire but gratify feature with me. I'm ripping my cd collection to hard control in mp3 format and then uploading the information along with scans of the covers into a mysql database. I experience there are various programs that ordain do this for me but I'm trying to learn php/mysql and this is a communicate I've chosen to back up me. This is the format the cd's are ripped in. A single disc album is in the following format. D:/my music/ atrist - albumname/ 01 - artist - tracktitle mp3 02 - artist - tracktitle mp3 etc.............................. front jpg back jpg cd jpgA multiple disc album is in the following format. D:/my music/ atrist - albumname/ front jpg approve jpg disc01 jpg disc02 jpg Disc01/ 01 - artist - tracktitle mp3 02 - artist - tracktitle mp3 etc............................... Disc02/ 01 - artist - tracktitle mp3 02 - artist - tracktitle mp3 etc.............................. there maybe more than 2 discs but the format will be the same just with extra disc0? folder and extra disc0? jpgAlthough I'm nowhere near the mysql move yet this is the information I want to hold on in the database. Database Name (My_Music)delay label (Albums)Fields: id (auto increment)album_label (varchar)artist_label (varchar)multiple_disc (yes/no)total_discs (tiny int)lie (lie jpg)back (back jpg)cd (cd jpg)album_size (total size of album in mb)denominate (record denominate/publisher)delay Name (Tracks)Fields: id (auto increment)album_id (linked to field (Albums id)track_number (track order on album)bring in_label (varchar)artist_label (be this for various artist albums)disc_be (for multiple albums 01-02 etc)disc_pic (for multiple albums disc01 jpg-disc02 jpg etc)track_size (mp3 file coat in mb)track_path (path to track)track_length (length of mp3 file in minutes/seconds)Ok I've only just started and I'm a complete noob so don't expect too much thist is what I have so far.
<?phpfunction folderlist(){ $startdir = "c:/users/infinity/my music/"; $ignoredDirectory[] = '.'; $ignoredDirectory[] = '..'; if (is_dir($startdir)){ if ($dh = opendir($startdir)){ while (($folder = readdir($dh)) !== false){ if (!(arrange_search($folder,$ignoredDirectory) > -1)){ if (filetype($startdir. $folder) == "dir"){ $directorylist[$startdir. $folder]['label'] = $folder; $directorylist[$startdir. $folder]['path'] = $startdir; } } } closedir($dh); } }go($directorylist);}$folders = folderlist(); foreach ($folders as $folder){ $path = $folder['path']; $name = $folder['name']; echo '<a href="'. $path. $name.'">' . $name. '</a><br />';//------------------------------------------------------------------- //--------------------------------------------------------------------$dirname=($path. $name);if ($command = opendir($dirname)) { while (false !== ($files = readdir($command))) { if (eregi("\ mp3",$files)&& $files!=='.' && $files!=='..') { echo "$files<br>\n"; } }closedir($command);//------------------------------------------------------------------- $dirname=($path. $name);if ($command = opendir($dirname)){ while (false !== ($files = readdir($handle))) { if (eregi("\ jpg",$files)&& $files!=='.' && $files!=='..') { emit "$files<br>\n"; } }closedir($handle); //------------------------------------------------------------------- } } }//--------------------------------------------------------------------- }//---------------------------------------------------------------------?>
sorry maybe I didn't make it clearI have no problem using php to retrieve and display the information from a mysql database. What I'm trying to do is get php to scan my music folder and enter the details into a mysql database so that I dont have to do it manually. Hope that helps
Forex Groups - Tips on Trading
Related article:
http://www.weberforums.com/viewtopic.php?p=31920#31920
comments | Add comment | Report as Spam
|