Re: [PHP-DB] mysql, php, mp3 - a variable problem
Hi, Where do you get $info2 from? I only see $info in this function. .: Allowee function scan_dir($dir) { $info = New mphp3(2); $handle = @opendir($dir); while ($file = @readdir ($handle)) { if (eregi(^\.{1,2}$,$file)) { continue; } if(is_dir($dir.$file)) { scan_dir($dir.$file./); } else { $info-load(/.$dir.$file); $query =insert into mp3 ( file, path, artist, title, album) values ( '$info2-filename', '$dir', '$info2-v2_artist', '$info2-v2_title', '$info2-v2_album');; mysql_query($query); } } @closedir($handle); } scan_dir(mp3/); ? but all it does is to put the path ($dir) into the database. everything else is ignored. an error does not occur. since the simple demo works fine i think its a problem with the validity of variables. i'm new to php, so could anybody give me a hint on what mightbe wrong with my code please? thanx a lot -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql, php, mp3 - a variable problem
hi allowee, sorry, this was not meant to be. $info2 is supposed to be $info. my fault. but that is not the actual problem. Hi, Where do you get $info2 from? I only see $info in this function. .: Allowee function scan_dir($dir) { $info = New mphp3(2); $handle = @opendir($dir); while ($file = @readdir ($handle)) { if (eregi(^\.{1,2}$,$file)) { continue; } if(is_dir($dir.$file)) { scan_dir($dir.$file./); } else { $info-load(/.$dir.$file); $query =insert into mp3 ( file, path, artist, title, album) values ( '$info2-filename', '$dir', '$info2-v2_artist', '$info2-v2_title', '$info2-v2_album');; mysql_query($query); } } @closedir($handle); } scan_dir(mp3/); ? but all it does is to put the path ($dir) into the database. everything else is ignored. an error does not occur. since the simple demo works -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql, php, mp3 - a variable problem
hmmm, maybe this code.. $info-load(/.$dir.$file); if $dir = mp3s and $file = test.mp3 then it will load '/mp3s/test.mp3' you got that directory? I've seen the class and you are hiding the fopen error message, which could be the problem. .: Allowee On Saturday 07 June 2003 11:11, Ole Hornauer wrote: hi allowee, sorry, this was not meant to be. $info2 is supposed to be $info. my fault. but that is not the actual problem. Hi, Where do you get $info2 from? I only see $info in this function. .: Allowee function scan_dir($dir) { $info = New mphp3(2); $handle = @opendir($dir); while ($file = @readdir ($handle)) { if (eregi(^\.{1,2}$,$file)) { continue; } if(is_dir($dir.$file)) { scan_dir($dir.$file./); } else { $info-load(/.$dir.$file); $query =insert into mp3 ( file, path, artist, title, album) values ( '$info2-filename', '$dir', '$info2-v2_artist', '$info2-v2_title', '$info2-v2_album');; mysql_query($query); } } @closedir($handle); } scan_dir(mp3/); ? but all it does is to put the path ($dir) into the database. everything else is ignored. an error does not occur. since the simple demo works -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql, php, mp3 - a variable problem
Hi, Where do you get $info2 from? I only see $info in this function. I guess that the $info-values are formfieldvalues. $info-[db-field] is normaly used within a whileloop for outputing a select-statement. In the case of formfieldvalues you can use $formfieldname. .: Allowee function scan_dir($dir) ... $query =insert into mp3 ( file, path, artist, title, album) values ( '$info2-filename', '$dir', '$info2-v2_artist', '$info2-v2_title', '$info2-v2_album');; mysql_query($query); ... Regards, Ruprecht -- Ruprecht Helms IT-Service und Softwareentwicklung Tel./Fax +49[0]7621 16 99 16 email: [EMAIL PROTECTED] Homep.http://www.rheyn.de -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql, php, mp3 - a variable problem
On Saturday 07 June 2003 11:20, Allowee wrote: hmmm, maybe this code.. $info-load(/.$dir.$file); if $dir = mp3s and $file = test.mp3 then it will load '/mp3s/test.mp3' you got that directory? I've seen the class and you are hiding the fopen error message, which could be the problem. .: Allowee hmmm. that won't work.. you can try $info-load(./.$dir./.$file); or simple.. $info-load($dir./.$file); .: Allowee -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql, php, mp3 - a variable problem
well, you are right. the dir '/mp3' does not exist. 'mp3' is a subdir from my htdocs dir. so i think the right path should be 'mp3/someartist/somesong', right? i fixed that, but the original problem is still the same :( hmmm, maybe this code.. $info-load(/.$dir.$file); if $dir = mp3s and $file = test.mp3 then it will load '/mp3s/test.mp3' you got that directory? I've seen the class and you are hiding the fopen error message, which could be the problem. .: Allowee On Saturday 07 June 2003 11:11, Ole Hornauer wrote: hi allowee, sorry, this was not meant to be. $info2 is supposed to be $info. my fault. but that is not the actual problem. Hi, Where do you get $info2 from? I only see $info in this function. .: Allowee function scan_dir($dir) { $info = New mphp3(2); $handle = @opendir($dir); while ($file = @readdir ($handle)) { if (eregi(^\.{1,2}$,$file)) { continue; } if(is_dir($dir.$file)) { scan_dir($dir.$file./); } else { $info-load(/.$dir.$file); $query =insert into mp3 ( file, path, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql, php, mp3 - a variable problem
moin, sorry, my php-knowledge is not the best. what do you mean with formfieldvalues? i think $info-value is used to get the id3-tag info from the class, right? this worked for me in a more simple way without the recursive scan: ? include(mphp3.php); $info = New mphp3(2); mysql_connect(192.168.100.12,user,password); mysql_select_db(music); $info-load(test.mp3); $abfrage =insert into mp3 ( file, artist, title, album) values ( '$info-filename', '$info-v2_artist', '$info-v2_title', '$info-v2_album');; mysql_query($abfrage); ? Hi, Where do you get $info2 from? I only see $info in this function. I guess that the $info-values are formfieldvalues. $info-[db-field] is normaly used within a whileloop for outputing a select-statement. In the case of formfieldvalues you can use $formfieldname. .: Allowee function scan_dir($dir) ... $query =insert into mp3 ( file, path, artist, title, album) values ( '$info2-filename', '$dir', '$info2-v2_artist', '$info2-v2_title', '$info2-v2_album');; mysql_query($query); ... Regards, Ruprecht -- Ruprecht Helms IT-Service und Softwareentwicklung Tel./Fax +49[0]7621 16 99 16 email: [EMAIL PROTECTED] Homep.http://www.rheyn.de -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php