binga30 Posted November 19, 2012 Share Posted November 19, 2012 Hello, I have 2 tables that each contain some data that is related. It's using wordpress and is referenced as follows: Table: wp_posts ID: 1 Table: wp_postmeta post_id: 1 The ID and post_id numbers correlate for each post. I need to grab data from the meta_value column in the wp_postmeta table by referencing the wp_posts table. I am using a premium theme which for some reason just returns blank when trying to call the data direct from wp_postmeta, yet when I echo different column data from wp_posts all is dandy. Quote Link to comment https://forums.phpfreaks.com/topic/270899-do-i-need-to-make-a-join-or-use-a-statement/ Share on other sites More sharing options...
trq Posted November 19, 2012 Share Posted November 19, 2012 And your question is? Quote Link to comment https://forums.phpfreaks.com/topic/270899-do-i-need-to-make-a-join-or-use-a-statement/#findComment-1393511 Share on other sites More sharing options...
binga30 Posted November 19, 2012 Author Share Posted November 19, 2012 How can i get the post_id by calling wp_posts. Quote Link to comment https://forums.phpfreaks.com/topic/270899-do-i-need-to-make-a-join-or-use-a-statement/#findComment-1393647 Share on other sites More sharing options...
fenway Posted November 21, 2012 Share Posted November 21, 2012 That would be a JOIN USING (post_id). Quote Link to comment https://forums.phpfreaks.com/topic/270899-do-i-need-to-make-a-join-or-use-a-statement/#findComment-1393984 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.