brosebro, on 28 October 2011 - 09:02 PM, said:
Hi Jack,
I'm get the error below. It's when I go into
"Categories/Products" then hit the ">" button!!
I'm using 2.3...
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 'from products p, products_description pd where p.products_id = pd.products_id an' at line 1
select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, from products p, products_description pd where p.products_id = pd.products_id and p.products_id = '75'
Any help would be appreciated.
Thank you!!
Hi,
I found solution. This is when you try to preview product in admin.
in admin/categories.php
find
$fieldStr = '';
$addedFieldsArray = GetAddedProductFields($_GET['pID'], $_GET['cPath']);
if (count($addedFieldsArray) > 0) {
foreach ($addedFieldsArray as $fields) {
if ($fields['table_name'] == TABLE_PRODUCTS) {
$fieldStr .= 'p.'.$fields['field_name'];
}
}
}
replace to
$fieldStr = '';
$addedFieldsArray = GetAddedProductFields($_GET['pID'], $_GET['cPath']);
if (count($addedFieldsArray) > 0) {
foreach ($addedFieldsArray as $fields) {
if ($fields['table_name'] == TABLE_PRODUCTS) {
$fieldStr .= 'p.'.$fields['field_name'] . ', ';
}
if ($fields['table_name'] == TABLE_PRODUCTS_DESCRIPTION) {
$fieldStr .= 'pd.'.$fields['field_name']. ', ';
}
}
}
find
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, " . $fieldStr . " from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
replace to
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, " . $fieldStr . " p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
Edited by bassmaga, 08 January 2012 - 04:30 PM.