have_posts ()) : $recent->the_post ();?>
global $wpdb;
$post_id = get_the_ID();
$pId = $post_id;
$row = $wpdb->get_results («SELECT COUNT (*) AS `total`,AVG (review_rating) AS `aggregate_rating`,MAX (review_rating) AS `max_rating` FROM wp_wpcreviews WHERE `page_id`= $pId AND `status`=1»);
$max_rating = $row[0]->max_rating;
$aggregate_rating = $row[0]->aggregate_rating;
$total_reviews = $row[0]->total;
$totl = $aggregate_rating * 20;
$wpdb->flush ();
php?>