[ciapug] OOPs... I hit a problem
Barry Von Ahsen
ciapug@cialug.org
Thu, 07 Apr 2005 12:50:46 -0500
Chris Van Cleve wrote:
> I use John Lim's excellent ADOdb library for database abstraction. (Now
> religious wars about using PEAR::DB etc. The choice is made and the
> debate is
> over) I have a file called core.php which contains the OOP for page
> rendering
> as well as setting up some constants, including the ADOdb library, and
> instantiating 3 DB connections. The problem? no queries ever return any
> results. This is odd since the exact same code works fine procedurally.
> Yes, I
> globalled the ADOdb connection objects.
>
I've had problems where 2 connections to 2 different databases would
give no results because queries meant for dbA get sent to dbB. It
turned out that "PHP sometimes reuses connections when you use Connect()
or PConnect()". Switching to NConnect() fixed the problem.
http://phplens.com/lens/adodb/docs-adodb.htm#nconnect
-barry