I know it should work with custom table and I think it worked in previous development I believe. But this time I don’t know whey it is not getting custom table with $wpdb->tablename
Code:
global $wpdb;
$items = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->review_media"));
This is not giving any result but when I tried with `$wpdb->prefix than it works
$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb->prefix."review_media"));
Any idea