I'm trying to get the key values for multiple posts with get_post_meta but am having no luck so far. In short, I have a function that adds 'votes' and 'thevoters' to each post. I want to check to make sure if someone's UserID is in any one of the 'thevoters' fields (spanning across multiple posts) they will not be able to vote again.
The following query gets the value of a specific post. I need to get the values across all posts with that key.
$voters = get_post_meta($id, 'thevoters', true);
My SQL query is:
SELECT * FROM `carcrazy_postmeta` WHERE meta_key='thevoters'
I am using this voting code as a reference - http://bavotasan.com/tutorials/simple-voting-for-wordpress-with-php-and-jquery/