Professional Documents
Culture Documents
html
full version: 1054 - unknown column 'p.products_id' in 'on clause' please help!
oscommerce community support forums > oscommerce online merchant v2.x > general
support
xpcpro
jan 10 2008, 06:09 pm
select count(p.products_id) as total from products_description pd, products p left
join manufacturers m on p.manufacturers_id = m.manufacturers_id,
products_to_categories p2c left join specials s on p.products_id = s.products_id
where p.products_status = '1' and p.products_id = p2c.products_id and
pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id =
'35'
[tep stop]
patches to correct this are included with each release of oscommerce and are
generally in the extras directory. the files have names like update-yyyymmdd.html
and update-yyyymmdd.txt.
these files contain a shed load of patches that should be applied to a stock
install, but as this is not shown as a step in the documentation / installation
instruction that i have read, most people won't until they run into a problem.
then they will find a solution to one problem via the forums.
------------------------------------------------------------------------------
table of contents
------------------------------------------------------------------------------
## update 051113
customer_country_id in addressbook
## update 051112
------------------------------------------------------------------------------
mysql 5.0 compatibility
------------------------------------------------------------------------------
problem:
mysql 5.0 introduces server sql modes as part of its sql 2003 standards support,
and uses a more stricter approach to executing sql queries. this is performed by
default with setting strict_trans_tables as a server sql mode.
due to this new setting, mysql fails on certain sql queries and produces error
messages on the screen.
solution:
$from_str = "from " . table_products . " p left join " . table_manufacturers . " m
using(manufacturers_id) left join " . table_specials . " s on p.products_id =
s.products_id, " . table_products_description . " pd, " . table_categories . " c,
" . table_products_to_categories . " p2c";
to:
$from_str = "from " . table_products . " p left join " . table_manufacturers . " m
using(manufacturers_id) left join " . table_specials . " s on p.products_id =
s.products_id";
to:
to:
$listing_sql = "select " . $select_column_list . " p.products_id,
p.manufacturers_id, p.products_price, p.products_tax_class_id, if(s.status,
s.specials_new_products_price, null) as specials_new_products_price, if(s.status,
s.specials_new_products_price, p.products_price) as final_price from " .
table_products . " p left join " . table_specials . " s on p.products_id =
s.products_id, " . table_products_description . " pd, " . table_manufacturers . "
m where p.products_status = '1' and pd.products_id = p.products_id and
pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id =
m.manufacturers_id and m.manufacturers_id = '" .
(int)$http_get_vars['manufacturers_id'] . "'";
to:
to:
to: