Re: Getting total results

From: Date: Wed, 29 Dec 2004 16:49:13 +0000
Subject: Re: Getting total results
References: 1 2 3 4 5 6 7 8  Groups: php.db 
Request: Send a blank email to php-db+get-37912@lists.php.net to get a copy of this message
Joseph Crawford wrote:
Actually i thought keeping all the data in one query stored in a class was more efficient than a database connection with each page change, however if i am wrong please explain why more database connections is less efficient...
Your class isn't persisting over pages, though, is it? If so, how are you doing it? A singleton class is good for multiple calls to it on the same page / within the same script. It doesn't persist across pages unless you're doing something else with it. Even if you are, serializing/unserializing (I assume) a class with 100 data units in it may not be more efficient than connecting to the database and just retrieving 10 data units at a time... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#37912) next »