problem calling getID3() from database URL

The place for "I can't figure out how to..." questions.
Post Reply
Guest

problem calling getID3() from database URL

Post by Guest » Tue Oct 29, 2002 4:56 pm

Beste mede PHPers,
ik ben de hele nacht bezig geweest met het getid3 script, Als ik het volgende script gebruik gaat het perfect:
I've been working the whole night to get this working but it still doesn't work, if i use this script it works perfect:

[php]<?
include_once "getid3.php";
$mp3info = getAllMP3Info("http://www.amendo.nl/1.mp3");
print_r($mp3info);
?>[/php]
Gebruik ik dit script dan wil het niet meer!
But when i use this script it doesn't work:
[php]<?php
include "database.php";
$query="SELECT * from mp3s";
$result=mysql_query($query);
while ($row=mysql_fetch_arry($result)) {
$mp3info = getAllMP3Info($row[URL]);
print_r($mp3info);
}
?> [/php]
het script eeft dan wel een output maar dan nietw at ik wil hebben het bovenste script geeft:
The first script gives output:

Code: Select all

Array 
( 
    [getID3version] => 1.5.4 
    [fileformat] => mp3 
    [exist] => 1 
    [filename] => http://home.t-online.de/home/HHappe/maythisbelove.mp3 
    [filesize] => 1519251 
    [mpeg] => Array 
        ( 
            [audio] => Array 
                ( 
                    [raw] => Array 
                        ( 
                            [synch] => 4094 
                            [version] => 3 
                            [layer] => 1 
                            [protection] => 1 
                            [bitrate] => 9 
                            [frequency] => 0 
                            [padding] => 1 
                            [private] => 0 
                            [channelmode] => 0 
                            [modeextension] => 0 
                            [copyright] => 0 
                            [original] => 0 
                            [emphasis] => 0 
                        ) 

                    [version] => 1 
                    [layer] => III 
                    [protection] => 
                    [bitrate] => 128 
                    [frequency] => 44100 
                    [padding] => 1 
                    [private] => 
                    [channelmode] => stereo 
                    [channels] => 2 
                    [modeextension] => 
                    [copyright] => 
                    [original] => 
                    [emphasis] => none 
                    [framelength] => 418 
                    [bitratemode] => CBR 
                ) 

        ) 

    [frequency] => 44100 
    [channels] => 2 
    [bitrate_audio] => 128000 
    [audiodataoffset] => 0 
    [bitrate_mode] => cbr 
    [audiobytes] => 1519251 
    [playtime_seconds] => 94.9531875 
    [bitrate] => 128000 
    [playtime_string] => 1:35 
) 
het onderste geeft alleen:
The second script gives only:

Code: Select all

Array 
( 
    [getID3version] => 1.5.4 
    [exist] => 
    [filename] => http://home.t-online.de/home/HHappe/maythisbelove.mp3 
) 
weet iemand hoe dat kan?
do you know how i can solve the problem?

Met vriendelijke Groeten
Daan Biere

James Heinrich
getID3() v1 developer
Posts: 1427
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Post by James Heinrich » Tue Oct 29, 2002 5:52 pm

It looks like you're doing it right - my guess would be that the URL you are calling with is invalid in some way? Perhaps it is URL-encoded, or it has slashes added?

I tried parsing that file (http://home.t-online.de/home/HHappe/maythisbelove.mp3) and it worked fine for me, so I suspect that the URL has been changed somehow going into and out of the database :?:

If you still can't find the problem, try this:[php]include "database.php";
$query = "SELECT * FROM mp3s";
$result = mysql_query($query);
echo '<PRE>';
while ($row = mysql_fetch_array($result)) { // notice typo in original code
echo PrintHexBytes($row['URL'])."\n";
echo PrintTextBytes($row['URL'])."\n\n";
}
echo '</PRE>';[/php]This will print out the hex versions of each byte of the URL you're trying to parse - maybe you can see something that's not supposed to be there?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests