Minimizing Database Hits
| From: | Ralph | Date: | Tue, 01 Jul 2003 22:41:08 +0000 |
| Subject: | Minimizing Database Hits | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153627@lists.php.net to get a copy of this message | ||
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?