RE: [PHP] Fatal error: Call to a member function query() on a non-object in C:\Xampp\xa...
| From: | Ford, Mike | Date: | Wed, 28 Jun 2006 12:52:07 +0000 |
| Subject: | RE: [PHP] Fatal error: Call to a member function query() on a non-object in C:\Xampp\xa... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-238790@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: j.kuehne@sign-tronic.ch [mailto:j.kuehne@sign-tronic.ch]
> Sent: 28 June 2006 10:10
> Fatal error: Call to a member function query() on a
> non-object in
> C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line 81
>
> Even though the $connection has already been established in a
> other .php file.
You can't do that -- there's simply no way to pass a database connection
from one script to the next.
> However, it should work since there is a
> global declaration.
That's not what a global declaration is about. Please go read the fine
manual again:
http://ch.php.net/manual/de/language.variables.scope.php#language.variab
les.scope.global
Cheers!
Mike
------------------------------------------------------------------------
----------------
Mike Ford, Electronic Information Services Adviser, Learning Support
Services,
JG125, The Library, James Graham Building, Headingley Campus, Beckett
Park,
LEEDS, LS6 3QS, United Kingdom
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm