Re: [PHP] Use of Class Reference Variable in another Class

2004-02-04 Thread BAO RuiXian
news.php.net wrote: >[snip...] > >Inside another class (Class2) I have several functions that need database >access. So in each function I can use "$db = new dbi;" and then use the >functions as usual ($db->dbquery("blah");). > >I am wondering, can I create the new "dbi" instance at the top of

[PHP] Use of Class Reference Variable in another Class

2004-02-04 Thread news.php.net
Inside of a class I am trying to make a call to a function in another class. I have one class defined to be my DataBase Interface call "dbi". To use that class I do this: $db = new dbi; Then I can use the functions in "dbi" like this: $db->dbquery("select * from whatever"); Inside another cla