Gunita Posted March 18, 2010 Posted March 18, 2010 1064 - 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}2 and language_id = '3'' at line 7 SELECT pd.products_name, pb.*, p.products_bundle, p.products_id, p.products_price, p.products_image FROM products p INNER JOIN products_description pd ON p.products_id=pd.products_id INNER JOIN products_bundles pb ON pb.subproduct_id=pd.products_id WHERE pb.bundle_id = 163{1}2 and language_id = '3' :'(
MrPhil Posted March 18, 2010 Posted March 18, 2010 WHERE pb.bundle_id = 163{1}2 and language_id = '3' A field value of 163{1}2 is invalid for SQL. If that really is the correct value, it needs to be in quotes: '163{1}2'. What is this "bundle_id" field defined to be? If it's character text of some sort, you could use '163{1}2', but if it's an integer that won't work. You would add quotes to the PHP code that produces the query, so that the field value has quotes around it.
Gunita Posted March 18, 2010 Author Posted March 18, 2010 Thanks for your answer! Here I leave you the code and tell me where fails... If you want:) It was the contribution bundled products Framework in bold where is the part of code supposedly erroneous $bundle_query = tep_db_query(" SELECT pd.products_name, pb.*, p.products_bundle, p.products_id, p.products_price, p.products_image FROM products p INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id=pd.products_id INNER JOIN " . TABLE_PRODUCTS_BUNDLES . " pb ON pb.subproduct_id=pd.products_id WHERE pb.bundle_id = " . $HTTP_GET_VARS['products_id'] . " and language_id = '" . (int)$languages_id . "'"); thanks!
Gunita Posted March 18, 2010 Author Posted March 18, 2010 Yessssss! It got! : P I'm newbie, but insistent! I have done the following WHERE pb.bundle_id = " . " ' ".$HTTP_GET_VARS[products_id]." ' " . " and language_id = ' " . (int)$languages_id . " ' "); Really thanks for help me! Nice to meet you!!! Lalalalala
MrPhil Posted March 19, 2010 Posted March 19, 2010 More easily: WHERE pb.bundle_id = '" . $HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); That's a single quote-double quote and double quote-single quote, in case you have trouble reading it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.