Re: mysql, php, mp3 - a variable problem
| From: | Allowee | Date: | Sat, 07 Jun 2003 08:56:39 +0000 |
| Subject: | Re: mysql, php, mp3 - a variable problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28397@lists.php.net to get a copy of this message | ||
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