In wordpress, custom posts are held in the wp_posts
table, and their ID is referenced in another table wp_meta
with the following columns post_id, meta_key, meta_value
Let's say I have a recipe called pudding
in wp_posts
, and in wp_meta
I have 3 meta_keys: "time_for_preparation", "ingredients", "difficulty"
How do I write a mysql query that returns me a single row with the 3 meta_keys?
If I do an inner join I'll just see 3 sets of "pudding", each with the same wp_posts
data and ONE different meta_key
What I want is a single row of pudding
with an array of meta_keys
can that be done?