Guest Posted February 19, 2004 Share Posted February 19, 2004 I have a client with over 2500 items in their catalog. The sysadmin hosting the site contacted us with an urgent request to fix a script which was returning the entire 2500 record result set, and was grinding the server down. Upon investigation, I found it was in the PriceFormatter::loadProduct() method. The query in this method has a couple of left outer joins, the second of which isn't sufficiently constrained, so it returns all the records. I'm not 100% certain, but I think PriceFormatter.php comes from the above-captioned contribution at: http://www.oscommerce.com/community/contributions,1242 To fix this problem, simply replace the last line of the query with this: " and pd.language_id = '". (int)$language_id ."'" . " and p2c.products_id = '". (int)$product_id ."'"; We're basicly just adding the p2c constraint, and that causes the query to return a single record, which is what we're looking for. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.