Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064 - You have an error in your SQL syntax.


Kjolebutikken

Recommended Posts

Posted

Hi, I have this error from my catalog/pdf/pdf_datasheet_function.php file:

 

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 'products_to_products_extra_fields ptf ON ptf.products_extra_fi

 

select p.products_id, pd.products_name, p.products_image, p.products_model, p.products_price, ptf.products_extra_fields_value, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.products_status, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, s.expires_date, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id products_to_products_extra_fields ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id where p.products_id = '33' and p.products_id = pd.products_id and pd.language_id = '4' and ptf.products_id=0 and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='4') ORDER BY products_extra_fields_order

 

[TEP STOP]

 

In my pdf_datasheet_function.php file, it looks like this:

 

$print_catalog_query = tep_db_query("select p.products_id, pd.products_name, p.". PDF_ALT_IMAGE .", p.products_model, p.products_price, ptf.products_extra_fields_value, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.products_status, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,  s.expires_date, m.manufacturers_name
					from ". TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id where
					p.products_id = '" . $products_id . "' and
					p.products_id = pd.products_id
					and pd.language_id = '" . $languages_id . "' and
					ptf.products_id=". (int)$HTTP_GET_VARS['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
ORDER BY products_extra_fields_order");

 

Can someone please help me find the syntax error in my code ?

 

 

Thanks:-)))

Best regards

Kjolebutikken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...