WordPress How to get value from get_results function

am trying to get value from return object by wordpress get_results function but no success with it

sample code

    $myrows = $wpdb->get_results("SELECT SUM(view) as dviews FROM view_count WHERE post_id = '$pid'");

echo $myrows->dviews;   // echo nothing 

so any idea how to get the integer return as dviews from it

Read more here: WordPress How to get value from get_results function

Leave a Reply

Your email address will not be published. Required fields are marked *