Click to See Complete Forum and Search --> : unsure if sql statement correct


nutstretch
10-13-2006, 05:15 AM
I am using the database for oscommerce for a site i am working on. I need to select certain bits from certain tables. The tables have not been modified from the original installation

I am tring to pull out info for a type of product which because of the way that the database is structured means getting info from several tables.

when the user click on a link the id attached to that link is the product type. i need to find the products in the database with that type, the price, the image, the manufacturer.

I have created a sql statement but am unsre if the syntax is correct as it is a long time since i did complex statements.

Please could someone have a look and see if i have gone completely wrong.

Select categories_description.categories_id, products_to_categories.products_id, products.products_price, products.product_image, manufacturers.manufacturers_name FROM categories_description, products, products_to_categories, manufacturers WHERE categories_description.categories_name LIKE ‘$choice’ AND categories_description.categories_id LIKE products_to_categories.categories_id AND Products.products_id LIKE products_to_categories.products_id AND manufacturers.manufacturers_id LIKE products_manufacturers_is;

Thanks in anticipation
Nuts