Re: Classes and Functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/2/05, Unknown Unknown <phpinfolist@xxxxxxxxx> wrote:
>
> Hi everybody i have a class that i reference with:
> $DB= new DBInterface;
> outside a function it works fine, but using $DB inside a function changes
> the data type i think... i get an error saying i'm using a method on a
> non-object...
> any help appreciatted


if you mean by "inside a function", a method of your class DBInterface then
you can can use $this. Otherwise you can do something like:

$DB= new DBInterface();

and then I believe you should be able to use $DB at it is.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux