Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MySQL query help


Guest

Recommended Posts

Hello,

I'm a newbie at SQL, and I try to obtain in one query this information:

 

poducts_name

products_model

products_description

categories_name

products_price

products_quantity

 

but I can't, anyone can help me.... :cry:

Link to comment
Share on other sites

Try this:

select 

products_model,

products_name, 

products_description, 

products_price, 

categories_name, 

products_quantity



from 

`osc`.`products` as p,

`osc`.`products_description` as pd,

`osc`.`products_to_categories` as p2c,

`osc`.`categories_description` as c



where

p.products_id = pd.products_id

and

pd.language_id = 1

and

p2c.products_id = p.products_id

and

c.categories_id = p2c.categories_id

 

It assumes you only have one language setup and that the product only appears in one category.

Link to comment
Share on other sites

oook... now is working... this is the fnal query 8)

 

select 

products_model, 

products_name, 

products_description, 

products_price, 

categories_name, 

products_quantity 



from 

`products` as p, 

`products_description` as pd, 

`products_to_categories` as p2c, 

`categories_description` as c 



where 

p.products_id = pd.products_id 

and  

p2c.products_id = p.products_id 

and 

c.categories_id = p2c.categories_id

 

Thank you very much. :D

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...