Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error 1054 - Unknown column 'p.products_id' in 'on


fall31

Recommended Posts

I just installed the oscommerce and have done nothing to it.

 

In the catalog index page, i chose the the category "Hardwares" and then subcategory "keyboards", here comes the error.

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

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 = '4'

 

I typed thses SQL statements directly in MySQL and discovered that the red line above caused the problem.

If I moves the line "products_to_categories p2c" to the end of the FROM clause,

there will be the error "1054 - Unknown column 'p.manufacturers_id' in 'on clause'"

If I moves this line to FORM clause like this "FROM products_description pd, products_to_categories p2c, products p", there will be no error.

 

I wonder does anyone know the reason of this problem? or anyone knows where i can find this SQL statements and change it?

Link to comment
Share on other sites

I just installed the oscommerce and have done nothing to it.

 

In the catalog index page,  i chose the the category "Hardwares" and then subcategory "keyboards", here comes the error.

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

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 = '4'

 

I typed thses SQL statements directly in MySQL and discovered that the red line above caused the problem.

If I moves the line "products_to_categories p2c" to the end of the FROM clause,

there will be the error "1054 - Unknown column 'p.manufacturers_id' in 'on clause'"

If I moves this line to FORM clause like this "FROM products_description pd, products_to_categories p2c, products p", there will be no error.

 

I wonder does anyone know the reason of this problem? or anyone knows where i can find this SQL statements and change it?

 

either you are not connecting to the Data base or some of you tables are missing.Or some of your fields are missing.

 

Reinstall osc as per the installation guide and this should have gone.

 

Satish Mantri

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Thank you, Satish Mantri

I have resolved this problem, allthough i do not why.

 

I was using MySQL 5 before and i have tried 4 times all the same error. Then i downgrade to MySQL 4 and this error never come again.

 

I found that osc2.2 is not quite compatible with PHP5 and MySQL5.

Bad luck.

Link to comment
Share on other sites

  • 3 weeks later...

change "TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id"

with "TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id"

 

in /catalog/index.php

Link to comment
Share on other sites

  • 5 months later...
change "TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id"

with "TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id"

 

in /catalog/index.php

 

Hey, that worked!

 

Can anyone tell me why you should have to change the SQL statement in that way when using MYSQL 5?

 

Seems like it ought to affect the function of the SQL statement rather than its compatibility...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...