You are here

function download_count_statistics_get_daily_count in Download Count 6.2

Get the download count for a specific file on a specific day.

Parameters

$fid: The file_id from the files table for which to count downloads.

$date: The day (in YYYY-MM-DD format) for which to return the count data of the specified file.

Return value

An integer representing the total number of times $fid was downloaded on $date FALSE if unable to return the data.

File

./download_count_statistics.module, line 104
Provides statistics for download_count module data.

Code

function download_count_statistics_get_daily_count($fid, $date) {
  $sql = "SELECT * FROM {download_count_statistics} WHERE fid = %d AND DATE(FROM_UNIXTIME(timestamp)) = '%s'";
  return db_result(db_query($sql, $fid, $date));
}