(wpdb) Get postmeta meta values for cron job
-
This is really a nice plugin that actually saves data to wp_posts and wp_postmeta table of the database and I was planning to retrieve data/records through wpdb to be used for wp-cron job that actually sends csv report automatically in a certain time. but my problem is that I can’t query this right using wpdb since I’m still newbie into this. Can someone give me some tips or anything that actually retrieve the data from the database?
this is my current code:
<?php
global $wpdb;
$meta_v = $wpdb->get_col( “SELECT DISTINCT(meta_value) FROM $wpdb->postmeta WHERE post_id = ‘590’ ” );if( $meta_v ){
echo ‘ <p>RESULT: </p>’;foreach ($meta_v as $key => $value) {
$results .=$value;
}
}
echo $results;
?>Let’s say, we should query all submitted forms.
Thanks you in advance.
- The topic ‘(wpdb) Get postmeta meta values for cron job’ is closed to new replies.