I am making a product database for my website. I currently have:
Products Table: Product ID, Product name, Price
Product_meta Table: Pmeta_id, Product ID, metaKey, metaValue
I basically want it so I can query a product by specifying the meta key and either put a key=>value pair to it, or get the value by the key.
I believe WordPress has a similar approach but am not quite sure how to go about making the functions to get the data. I assume it will involve table joins???
Any help would be appreciated.
Or turn it around if the Products table is leading:
You can also change
LEFT OUTER JOINtoINNER JOINwhen you only want to display the records that are both in the Products table and in the Product_meta tableIf you want to have more than one value in the
WHEREclause then use this query:Make sure your data is comma seperated