greg Posted March 29, 2009 Share Posted March 29, 2009 The attached query works perfectly, only that I need something extra and after 5 hours, I think it is time to look for help. There are two tables I need to incorporate. table custom_options (fields custom_options_id and heading) table custom_options_products (fields custom_options_id and products_id) I need to get the heading from the table custom_options where custom_options.custom_options_id = to custom_options_products.custom_options_id and custom_options_products.products_id = products_id and products_id are the products_id for products in $current_category_id. There may be more than one heading for product. I have tried left join the customs to the current query and viceversa but I'm missing something. Someone please help me. Thank you! $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_quantity_order_min, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; Link to comment https://forums.phpfreaks.com/topic/151579-need-help-with-this-query/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.