Erald Posted February 2, 2004 Share Posted February 2, 2004 Ok I might be a fool, but am not a programmer and after searching for hours I could not find any solution. Hope anyone can help My problem; I have two shops one which works good the other one I have follwing problem When selecting a product which is in the shopping_cart it gives an SQL error. The error is understandable and I understand why it is the case. However I can not find anything how to avoid it. The error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '{1}1' at line 1<br><br>select * from products as p, products_description as pd where p.products_id = pd.products_id and pd.products_id = 59{1}1<br><br><small><font color="#ff0000">[TEP STOP] This is caused because when selecting the product the url is : .../catalog/product_info.php?products_id=59{1}1 In my other shop it is the same but it seems to strip off the {1}1 after the product_id. However I can not find any difference in the code in product_info.php nor in shipping_cart.php. I have been looking everywhere to find some difference but seem not to be able to figure out how exactly this is stripped. :( This piece off code is from product_info.php and should be the piece where it goes wrong $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); Any suggestion on where to look would be appreciated. Link to comment Share on other sites More sharing options...
Erald Posted February 5, 2004 Author Share Posted February 5, 2004 Does anyone know where these attribute id's are stripped from the product ID. For some of you it must be a piece of cake, but I can not find it anywhere. please!! Link to comment Share on other sites More sharing options...
Erald Posted February 5, 2004 Author Share Posted February 5, 2004 Okay found the problem after some more searching and eliminating things. Have installed skin manager 2 and in skin_top.php you will find a piece of code which caused the problem $prod_name_query = tep_db_query("select * from " . TABLE_PRODUCTS . " as p, " . TABLE_PRODUCTS_DESCRIPTION . " as pd where p.products_id = pd.products_id and pd.products_id = " . $HTTP_GET_VARS['products_id']); This should be $prod_name_query = tep_db_query("select * from " . TABLE_PRODUCTS . " as p, " . TABLE_PRODUCTS_DESCRIPTION . " as pd where p.products_id = pd.products_id and pd.products_id = " . (int)$HTTP_GET_VARS['products_id']); Sorry to have bothered this community Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.