Reputation: 99
I used the following code to run a wordpress query... //using the $thePost[ID], get the fees associated with this accommodation from within the post_meta table.
$post_meta_querystr = "
SELECT *
FROM $wpdb->postsmeta
WHERE $wpdb->postsmeta.post_id = '$thePost[ID]'
";
$customPostMeta = $wpdb->get_results($post_meta_querystr);
The table has fields called "meta_key" and "meta_value". I'd like to know how I can use the value of any row in "meta_key" to get its corresponding value from the "meta_value" field? Any help is greatly appreciated.
Upvotes: 0
Views: 620