Page 1 of 1

Call to a member function on a non-object

Posted: Sun Feb 12, 2006 7:18 pm
by soundboy
Hi... I know this is probably a dumb question since it's 3 simple lines of code, but I can't get this to work.

I did

Code: Select all

require_once ('includes/getid3/getid3.php');
$getID3 = new getID3;
And then

Code: Select all

$fileinfo = $getID3->analyze($path);
And I get
"Fatal error: Call to a member function on a non-object" for that last line of code. I'm not new to PHP, but I am new to objects, so I figure I must be missing something simple here.

Posted: Mon Feb 13, 2006 5:50 am
by soundboy
Nevermind, got it.

I was declaring the new object outside of the function where I was calling it. Didn't know I coulnd't do that.

Thanks anyway.