[nycphp-talk] PEAR DB_Cache question
Adam Maccabee Trachtenberg
adam at trachtenberg.com
Tue Dec 2 16:45:43 EST 2003
On Tue, 2 Dec 2003, David Mintz wrote:
> Ha! Speaking of which, in case you're considering coming out with another
> edition someday, a suggestion/question: wouldn't you want to use
> $db->setConnection($dsn) in this recipe, which "[registers] a database
> connection for connect on demand"? I can't understand why anyone would
> want to use the unconditional connect() when they're only planning to
> SELECT, if the whole point is to save db overhead. (Then again I've hardly
> mastered the internals ergo don't know what I'm talking about (-: )
Thanks for the tip. I will add this to this giant TODO list for the
Second Edition.
FWIW, here are the most likely answers to any similar questions:
1) That feature wasn't available when we wrote the book.
2) We weren't smart enough to realize that feature was available when
we wrote the book.
Usually, if we saw something you shouldn't do, we mentioned it. If a
feature is omitted, and it seems smart to use it, you probably
should. :)
-adam
--
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!
More information about the talk
mailing list