banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành Windows lỗi ở code hay lỗi config php mong đuoc giúp đỡ  XML
  [Question]   lỗi ở code hay lỗi config php mong đuoc giúp đỡ 31/03/2008 23:53:50 (+0700) | #1 | 122302
bigthacngayxua
Member

[Minus]    0    [Plus]
Joined: 24/02/2008 13:22:55
Messages: 5
Offline
[Profile] [PM]
Mình install thử x-cart (shopping cart) trên host, khi load trang đầu thì hiện ra lỗi này

INVALID SQL: 1054 : Unknown column 'xcart_products.productid' in 'on clause'
SQL QUERY FAILURE: SELECT COUNT(xcart_products.productid), MIN(xcart_pricing.price) as price , xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, MIN(v_pricing.price) as v_price FROM xcart_products, xcart_pricing , xcart_featured_products, xcart_products_categories, xcart_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid LEFT JOIN xcart_pricing as v_pricing ON v_pricing.variantid = xcart_variants.variantid AND v_pricing.quantity = 1 AND v_pricing.membership IN ('','') WHERE xcart_products.productid=xcart_featured_products.productid AND xcart_featured_products.avail='Y' AND xcart_featured_products.categoryid='105' AND xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.membership IN ('','') AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_pricing.variantid = 0 AND xcart_products_categories.productid=xcart_products.productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.membership IN ('','') AND xcart_products.forsale='Y' GROUP BY xcart_products.productid  




Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cuongn/public_html/bel/shop/include/func.php on line 85
INVALID SQL: 1054 : Unknown column 'xcart_products.productid' in 'on clause'
SQL QUERY FAILURE: SELECT COUNT(xcart_products.productid), MIN(xcart_pricing.price) as price , xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, MIN(v_pricing.price) as v_price, xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, MIN(v_pricing.price) as v_price FROM xcart_products, xcart_pricing , xcart_products_categories, xcart_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid LEFT JOIN xcart_pricing as v_pricing ON v_pricing.variantid = xcart_variants.variantid AND v_pricing.quantity = 1 AND v_pricing.membership IN ('','') WHERE xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.membership IN ('','') AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_pricing.variantid = 0 AND xcart_products_categories.productid=xcart_products.productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.membership IN ('','') AND xcart_products_categories.categoryid='105' AND (xcart_products_categories.main='Y' OR xcart_products_categories.main!='Y') AND xcart_products.forsale='Y' GROUP BY xcart_products.productid

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cuongn/public_html/bel/shop/include/func.php on line 85
INVALID SQL: 1054 : Unknown column 'xcart_products.productid' in 'on clause'
SQL QUERY FAILURE: SELECT xcart_products.productid, xcart_products.product, xcart_products.productcode, xcart_products.avail, MIN(xcart_pricing.price) AS price, IF (xcart_classes.classid IS NULL,'','Y') as is_product_options, IF(xcart_variants.variantid IS NULL,'','Y') as is_variant FROM xcart_products, xcart_categories, xcart_products_categories, xcart_pricing LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid WHERE xcart_products.productid=xcart_products_categories.productid AND xcart_products_categories.categoryid=xcart_categories.categoryid AND xcart_products.productid=xcart_pricing.productid AND xcart_pricing.quantity=1 AND (xcart_pricing.membership='' OR xcart_pricing.membership='') AND (xcart_categories.membership='' OR xcart_categories.membership='') AND xcart_products.forsale='Y' AND xcart_pricing.variantid = 0 AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_products_categories.categoryid IN (105) AND xcart_products.views_stats>0 AND xcart_products.sales_stats > 0 GROUP BY xcart_products.productid ORDER BY xcart_products.sales_stats DESC, xcart_products.views_stats DESC LIMIT 5  


mình chạy đến dòng 85 thì code là như thế này:


function db_num_rows($result) {
return mysql_num_rows($result);
}
 


cho mình hỏi lỗi nằm ở function db_num_rows hay tại vấn đề nằm ở config php trên server
mong mọi người chỉ mình cách giải quyết, xin đa tạ

đây là cấu hình field productid trong db của mình

Field | Type | Collation |Attributes |Null |Default | Extra
productid | int(11) | | | No |auto_increment |
[Up] [Print Copy]
  [Question]   Re: lỗi ở code hay lỗi config php mong đuoc giúp đỡ 01/04/2008 00:01:30 (+0700) | #2 | 122304
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
Như bạn thấy, phần mềm đã kết nối được vào MySql. Tức là fiel config đã đưa đúng thông tin về sever của data.
[Up] [Print Copy]
  [Question]   lỗi ở code hay lỗi config php mong đuoc giúp đỡ 01/04/2008 00:40:29 (+0700) | #3 | 122310
subnetwork
Member

[Minus]    0    [Plus]
Joined: 05/09/2004 06:08:09
Messages: 1666
Offline
[Profile] [PM] [WWW] [Yahoo!]

bigthacngayxua wrote:
Mình install thử x-cart (shopping cart) trên host, khi load trang đầu thì hiện ra lỗi này

INVALID SQL: 1054 : Unknown column 'xcart_products.productid' in 'on clause'
SQL QUERY FAILURE: SELECT COUNT(xcart_products.productid), MIN(xcart_pricing.price) as price , xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, MIN(v_pricing.price) as v_price FROM xcart_products, xcart_pricing , xcart_featured_products, xcart_products_categories, xcart_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid LEFT JOIN xcart_pricing as v_pricing ON v_pricing.variantid = xcart_variants.variantid AND v_pricing.quantity = 1 AND v_pricing.membership IN ('','') WHERE xcart_products.productid=xcart_featured_products.productid AND xcart_featured_products.avail='Y' AND xcart_featured_products.categoryid='105' AND xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.membership IN ('','') AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_pricing.variantid = 0 AND xcart_products_categories.productid=xcart_products.productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.membership IN ('','') AND xcart_products.forsale='Y' GROUP BY xcart_products.productid  




Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cuongn/public_html/bel/shop/include/func.php on line 85
INVALID SQL: 1054 : Unknown column 'xcart_products.productid' in 'on clause'
SQL QUERY FAILURE: SELECT COUNT(xcart_products.productid), MIN(xcart_pricing.price) as price , xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, MIN(v_pricing.price) as v_price, xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, MIN(v_pricing.price) as v_price FROM xcart_products, xcart_pricing , xcart_products_categories, xcart_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid LEFT JOIN xcart_pricing as v_pricing ON v_pricing.variantid = xcart_variants.variantid AND v_pricing.quantity = 1 AND v_pricing.membership IN ('','') WHERE xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.membership IN ('','') AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_pricing.variantid = 0 AND xcart_products_categories.productid=xcart_products.productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.membership IN ('','') AND xcart_products_categories.categoryid='105' AND (xcart_products_categories.main='Y' OR xcart_products_categories.main!='Y') AND xcart_products.forsale='Y' GROUP BY xcart_products.productid

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cuongn/public_html/bel/shop/include/func.php on line 85
INVALID SQL: 1054 : Unknown column 'xcart_products.productid' in 'on clause'
SQL QUERY FAILURE: SELECT xcart_products.productid, xcart_products.product, xcart_products.productcode, xcart_products.avail, MIN(xcart_pricing.price) AS price, IF (xcart_classes.classid IS NULL,'','Y') as is_product_options, IF(xcart_variants.variantid IS NULL,'','Y') as is_variant FROM xcart_products, xcart_categories, xcart_products_categories, xcart_pricing LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid WHERE xcart_products.productid=xcart_products_categories.productid AND xcart_products_categories.categoryid=xcart_categories.categoryid AND xcart_products.productid=xcart_pricing.productid AND xcart_pricing.quantity=1 AND (xcart_pricing.membership='' OR xcart_pricing.membership='') AND (xcart_categories.membership='' OR xcart_categories.membership='') AND xcart_products.forsale='Y' AND xcart_pricing.variantid = 0 AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_products_categories.categoryid IN (105) AND xcart_products.views_stats>0 AND xcart_products.sales_stats > 0 GROUP BY xcart_products.productid ORDER BY xcart_products.sales_stats DESC, xcart_products.views_stats DESC LIMIT 5  


mình chạy đến dòng 85 thì code là như thế này:


function db_num_rows($result) {
return mysql_num_rows($result);
}
 


cho mình hỏi lỗi nằm ở function db_num_rows hay tại vấn đề nằm ở config php trên server
mong mọi người chỉ mình cách giải quyết, xin đa tạ

đây là cấu hình field productid trong db của mình

Field | Type | Collation |Attributes |Null |Default | Extra
productid | int(11) | | | No |auto_increment |
 


Đọc kỹ yêu cầu của phần mềm trước khi dùng .
Quản lý máy chủ, cài đặt, tư vấn, thiết kế, bảo mật hệ thống máy chủ dùng *nix
http://chamsocmaychu.com
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|