0

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.

1 Answer 1

1

why don't you use the get_post_meta function?

Sign up to request clarification or add additional context in comments.

1 Comment

Ah ha!... I had forgotten about this function. Thank you sir for preventing me from reinventing the wheel :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.