I am trying to convert Wordpress data into my own database and their database structure is giving me issues. This is difficult to explain so bear with me.
I have two tables as followed. They are joined by wp_post.ID = wp_postmeta.post_id
.
wp_posts
+----+------------+--------------+
| ID | post_title | post_content |
+----+------------+--------------+
| 1 | Game Title | some content |
+----+------------+--------------+
wp_postmeta
+---------+--------------+------------+
| post_id | meta_key | meta_value |
+---------+--------------+------------+
| 1 | post_type | Review |
+---------+--------------+------------+
| 1 | game_rating | 8.0 |
+---------+--------------+------------+
| 1 | game_genre | FPS |
+---------+--------------+------------+
Right now I have to do a query for every single meta_value entry I want (WHERE meta_value = 'Review'
) for example.
Is there a way for me to run a single query and return post_title, post_content, post_type, gaming_rating, and game_genre?