Hello everyone,
I want to display the total count number for all files, already tried the following codes but not working.
1. The code displays nothing.
<?php
global $wpdb;
$total_downloads = $wpdb->get_var("SELECT SUM(hits) FROM wp_download_monitor_stats ");
echo $total_downloads;
?>
2. The code displays "0".
<?php
global $wpdb;
$total_downloads = $wpdb->get_var( $wpdb->prepare("SELECT SUM(hits) FROM wp_download_monitor_stats") );
return number_format_i18n($total_downloads, 0, '.', ',');
?>
Does anyone who have a solution?
Thanks a lot!