Re: Class variables and scope
| From: | Stuart Dallas | Date: | Fri, 31 May 2002 15:16:30 +0000 |
| Subject: | Re: Class variables and scope | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100105@lists.php.net to get a copy of this message | ||
On Friday, May 31, 2002 at 4:11:42 PM, you wrote:
> When I try to work with the first instance of my class, I get an error which
> I finally tracked down to it trying to run it's SQL queries against the
> database defined in $c2. Now, I was under the impression that class
> variables were private to each instance, however, this seems to be acting
> like a static var.
You need to specify $this->conn in each mysql_* function you call otherwise it
will be called against the last connection made.
--
Stuart