osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Categories.php bugfix for larger stores

This is a discussion on Categories.php bugfix for larger stores within the osCMax v2 Installation issues forums, part of the osCMax v2.0 Forums category; We had posted a message or two here about a handler error. We have over 10,000 products that are cross-linked ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Installation issues

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 08-05-2005, 09:32 PM
gamefreak7's Avatar
Member
 
Join Date: Apr 2005
Location: Michigan, USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gamefreak7
Default Categories.php bugfix for larger stores

We had posted a message or two here about a handler error. We have over 10,000 products that are cross-linked in categories so much that the sql query on mysql 4.0 crapped out and gave a false 1028 table handler error. I think larger stores will see this in the future. The fix is here.

In categories.php, change this:

$products_query = tep_db_query("select p.products_ship_price, p.products_id, p.products_model, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' or p.products_model like '%" . tep_db_input($search) . "%' order by pd.products_name");

to this:

$products_query = tep_db_query("select p.products_ship_price, p.products_id, p.products_model, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id
from " . TABLE_PRODUCTS . " p
INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id
INNER JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON p.products_id = p2c.products_id
where pd.language_id = '" . (int)$languages_id . "'
and pd.products_name like '%" . tep_db_input($search) . "%' or
p.products_model like '%" . tep_db_input($search) . "%' order by pd.products_name");

This will prevent categories admin page searches from timing out or filling up the /tmp directory and giving 1028 error.

Thanks to Eric!
__________________
Paul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Bugfix 85-checkout_shipping_address checkout_payment_address kenlyle osCMax v2 Features Discussion 1 01-05-2006 08:56 AM
larger colums? amilo osCMax v1.7 Discussion 2 02-29-2004 02:49 AM
Larger left_column? amilo osCMax v1.7 Discussion 0 01-20-2004 11:38 PM
[BugFix] v1.5 Category Descriptions Bug michael_s osCMax v1.7 Discussion 0 09-25-2003 10:50 PM
[BugFix]Change Currenices From product_info.php failing michael_s osCMax v1.7 Discussion 0 09-06-2003 11:55 AM


All times are GMT -8. The time now is 10:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax