tristanlee85
25th July 2006, 03:21
I've got X-cart installed on my server and appearantly there are issues with the SQL queries when joining tables. It works fine on MySQL 4, but the issues started in 5.
I'm going to copy and paste my error log:
[29-Apr-2006 02:29:23] SQL error: /xcart/home.php
SELECT COUNT(DISTINCT(xcart_products.productid)) FROM xcart_products, xcart_pricing , xcart_products_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' WHERE xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.variantid = 0 AND xcart_pricing.membership IN ('','') AND xcart_products_categories.productid=xcart_products .productid AND xcart_products_categories.categoryid='2' AND (xcart_products_categories.main='Y' OR xcart_products_categories.main!='Y') AND xcart_products.forsale='Y'
1054 : Unknown column 'xcart_products.productid' in 'on clause'
-------------------------------------------------
[29-Apr-2006 02:58:58] SQL error: /xcart/product.php
SELECT xcart_classes.*, xcart_class_options.*, xcart_class_lng.class as class_lng, xcart_class_lng.classtext as classtext_lng, xcart_product_options_lng.option_name as option_name_lng FROM xcart_class_options, xcart_classes LEFT JOIN xcart_product_options_lng ON xcart_class_options.optionid = xcart_product_options_lng.optionid AND xcart_product_options_lng.code = 'US' LEFT JOIN xcart_class_lng ON xcart_classes.classid = xcart_class_lng.classid AND xcart_class_lng.code = 'US' WHERE xcart_classes.productid = '34' AND xcart_classes.classid = xcart_class_options.classid AND xcart_class_options.avail = 'Y' AND xcart_classes.avail = 'Y'
1054 : Unknown column 'xcart_class_options.optionid' in 'on clause'
One guy stated that I have to put everything in brackets for MySQL 5. There are so many files to edit I figured going to MySQL 4 would be easier. Any suggestions? Here is what I was suggested to do:
FROM
(xcart_products,
xcart_pricing ,
xcart_featured_products,
xcart_products_categories,
xcart_categories)
I'm going to copy and paste my error log:
[29-Apr-2006 02:29:23] SQL error: /xcart/home.php
SELECT COUNT(DISTINCT(xcart_products.productid)) FROM xcart_products, xcart_pricing , xcart_products_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' WHERE xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.variantid = 0 AND xcart_pricing.membership IN ('','') AND xcart_products_categories.productid=xcart_products .productid AND xcart_products_categories.categoryid='2' AND (xcart_products_categories.main='Y' OR xcart_products_categories.main!='Y') AND xcart_products.forsale='Y'
1054 : Unknown column 'xcart_products.productid' in 'on clause'
-------------------------------------------------
[29-Apr-2006 02:58:58] SQL error: /xcart/product.php
SELECT xcart_classes.*, xcart_class_options.*, xcart_class_lng.class as class_lng, xcart_class_lng.classtext as classtext_lng, xcart_product_options_lng.option_name as option_name_lng FROM xcart_class_options, xcart_classes LEFT JOIN xcart_product_options_lng ON xcart_class_options.optionid = xcart_product_options_lng.optionid AND xcart_product_options_lng.code = 'US' LEFT JOIN xcart_class_lng ON xcart_classes.classid = xcart_class_lng.classid AND xcart_class_lng.code = 'US' WHERE xcart_classes.productid = '34' AND xcart_classes.classid = xcart_class_options.classid AND xcart_class_options.avail = 'Y' AND xcart_classes.avail = 'Y'
1054 : Unknown column 'xcart_class_options.optionid' in 'on clause'
One guy stated that I have to put everything in brackets for MySQL 5. There are so many files to edit I figured going to MySQL 4 would be easier. Any suggestions? Here is what I was suggested to do:
FROM
(xcart_products,
xcart_pricing ,
xcart_featured_products,
xcart_products_categories,
xcart_categories)