Re: Classes and Functions and If's (Problems Again)

From: Date: Thu, 03 Nov 2005 23:46:35 +0000
Subject: Re: Classes and Functions and If's (Problems Again)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-225076@lists.php.net to get a copy of this message
On 11/4/05, Unknown Unknown <phpinfolist@gmail.com> wrote: > Hi everyone, i have some code that proccesses a login form. i have an object > $DB which works only in SOME areas, this is the code: > [...] > $DB="membersp"; > $SQL="SELECT ID FROM membersonline WHERE ID='$ID' "; > $DB->Query($SQL); [...] > i get an error saying: > > *Fatal error*: Call to a member function Query() on a non-object in * > D:\Apache\Apache(re)\Apache2\htdocs\LoginP.php* on line *21* > but before line 21 i use $DB and it works fine, but line 21 is a problem, > any help appreciated You've not indicated which is line 21, but I presume it's the bit shortly after you assigned a string to $DB. A string is not an object, hence the error message. -robin

« previous php.general (#225076) next »