I need help with this query

Discussion in 'PHP' started by Batismer, Mar 29, 2009.

  1. #1
    Hey folks,

    I'm hoping someone may be able to provide me with some pointers on this. I got the attached query working however I need to add some data from other tables.

    There are two tables I need to pull info from.
    table custom_options (fields custom_options_id and option_name)
    table custom_options_products (fields custom_options_id and products_id)

    I need to pull the option names for products in the $current_category_id.
    One point is that one product may have more than one option.

    Thank you for your help.
    Greg

    $products_query_raw = "select p.products_id, p.products_image, 
    p.products_model, pd.products_name, p.products_status, p.products_weight, 
    p.products_quantity, p.manufacturers_id, p.products_quantity_order_min, 
    p.products_price, products_price_list, products_quantity_order_units, 
    p.products_tax_class_id, p.products_industry, p.products_rush_service 
    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 ";
    PHP:
     
    Batismer, Mar 29, 2009 IP