[ciapug] OOPs... I hit a problem
Chris Van Cleve
ciapug@cialug.org
Thu, 7 Apr 2005 13:32:10 -0500
Wow, THANK YOU guys!
Between the two of you, I solved my dilemma. I had completely forgotten
about ADOdb's debugger. Thank you Brian. Enabling that showed me that
it was looking at the wrong database, hence the table I was querying
didn't exist. Oddly enough the reason it was hitting the wrong DB is
precisely what Barry pointed out. I admit to being a bit flabbergasted.
This same code, procedurally, has been working for two years without an
issue. I don't know why putting it in OOP suddenly caused the DB
connections to cross. It never would have occurred to me. Thanks, guys!
Now, can anyone recommend a good hair replacement product? I seem to
have pulled all of mine out...
Chris VC
On Apr 7, 2005, at 12:50 PM, Barry Von Ahsen wrote:
> 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
>
>
> _______________________________________________
> ciapug mailing list
> ciapug@cialug.org
> http://cialug.org/mailman/listinfo/ciapug
>
>