Jump to content

[SOLVED] Syntax error on a multiple left join with a where clause


kts

Recommended Posts

I'm trying to get the where clause to respond only where the categories_id is similiar to the $cPath variable I'm sending. It works without the where clause, and I have it all included, so im not sure why it won't allow for this where clause.

 

<?php
    $cquery = "SELECT products.products_id, products.products_price, products.products_quantity, products.products_image, products.products_status, products_description.products_name, products_description.products_description, products_description.language_id, products.manufacturers_id, products_to_categories.categories_id, categories_description.categories_name
          FROM  products
	  JOIN products_description ON (products.products_id = products_description.products_id)
          JOIN products_to_categories ON (products_description.products_id = products_to_categories.products_id) JOIN categories_description ON (products_to_categories.categories_id = categories_description.categories_id) where products_to_categories.categories_id = $cPath";
?>

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.