Re: [PHP4BETA] Newbie question about classes and databases...
| From: | Michael Stearne | Date: | Thu, 02 Mar 2000 18:56:39 +0000 |
| Subject: | Re: [PHP4BETA] Newbie question about classes and databases... | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11378@lists.php.net to get a copy of this message | ||
Why don't you try db classes that are already built to do this? I've heard of
a couple lately. There is PHPLIB and Metabase
(http://phpclasses.UpperDesign.com/) and others in the works.
Ryan Robertson wrote:
> Hello,
>
> I'm trying to create a class to encapsulate most of my database
> functionality. Everything works just fine until I execute a query in the
> class. The first time I execute a query, everything seems to work fine.
> The second time I get a message saying that the class cannot be redeclared.
>
Are you trying to do two queries within the same page or on different page
requests?
>
> Do I need to explicitly destroy the class object or is there some weird
> class/database/caching interaction going on? Below is a copy of the code
> I'm executing and a copy of the database connection class.
>
> Note that if I don't call the Query method, everything works just fine. Do
> I need to do something special to delete query objects?
>
You could try odbc_close_all() or odbc_close() after the query.
Michael
P.S. You work at palm. What do you care if it works? You can quit after
today. :-)