Hello,

On 07/01/2003 07:41 PM, Ralph wrote:
I wrote class that contains a function that retrieves users shopping
cart items from database and then returns an array with qty, item number
, item name, etc.

So now whenever I want to retrieve the users cart I use the following:

$cart_contents = $cart->get_cart_contents();

I then iterate through $cart_contents to display info. Now I am trying
to minimize the number of hits to the database so my question is, am I
querying the database every time I call on $cart_contents?

A common solution is to serialize() and cache the results in disk files. For arbitrary data caching, you may want to try this class:


http://www.phpclasses.org/filecacheclass

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to