Hello everyone, how are you? I am studying mysql and am using a wordpress database with woocommerce. I can not perform a select the way I need it. In the database I have 2 tables wp_posts
and wp_postmeta
and the data of the products are written in both tables through relationship, my problem is in the table wp_postmeta la is used the meta data and never worked with them.
I have 4 fields: meta_id
- post_id
- meta_key
and meta_value
.
meta_id
- is the id of the table. - post_id
- is the relationship key with the wp_posts
table. meta_key
- is the key of each field, exe: value, color and characteristics. meta_value
- is the value of each key.
So for each product in the database I have several records in the wp_postmeta table, and when I do the select I end up having multiple records repeated, I need the select to return the product and all its features tried a lot of things I did not succeed, everything which is join I found I tried, the more I know the something between the syntax of sql and the meta data, if anyone can help I'm grateful.
And excuse anything.