On Wednesday 31 July 2002 22:40, Paul Dionne wrote:
>
> I have a class in my script which has information on specific tables such
> as standard queries, tablenames, Index field...
>
> Then there is a function called StandardDropDown($ItemNum, $Name) which
> gets the info from the appropriate table you want and displays a dropdown
> menu based on the table.
>
> $ItemNum referrs to the table I want to output, $Name is what I want to
> call the dropdown in the HTML output.
>
> When I call the function directly from a page it works great.
>
> When I call it from another function I get an error:
>         Fatal error: Call to a member function on a non-object in
>         /var/www/html/COMESA/theme/functions.inc on line 61
>
> This is line 61: $TableName= $ItemNum->get_TableName();
>
> As I said, I only get this error when I call from a function, not if I call
> directly from a page.  I don't see why that should make any difference
> though.

In your function declare your object as global.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Save the Whales -- Harpoon a Honda.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to