Martin Lucas-Smith wrote:
I have a class from within which other classes are called.
In the constructor, I want to create an instance of a database
connection, so that this database can be called elsewhere.
Variables in functions are destroyed when the function is finished. You
have to define your variable outside the class and do global $database;
everywhere you need it. It also might be interesting to (re)read the
part about scopes in the PHP Manual.
--
Pieter Nobels