php - MySQL inner join with two tables -
i'm new mysql , php , i'm struggling inner joins between 2 tables. i'm constructing script reads os commerce database , tells me products on order. in order product on order value in products_attributes table set '134', reads product_id , not product_model in 'products' table.
products_attributes(table name) options_values_id product_id products(table name) product_id product_model
i want select items have value of '134' in products_attributes table match product_ids both tables product_model "products" table. feel code easy reason i'm struggling how construct query , display it.
select product_model products p,products_attributes pa p.product_id = pa.product_id , pa.options_values_id = 134
or
select p.product_model products p inner join products_attributes pa on (p.product_id = pa.product_id) pa.options_values_id = 134
Comments
Post a Comment