I have in a mysql table the number of downloads for a specific file.
I use the following code to fetch the number of downloads:
<?php $debname = 'com.dev.package_1.0-1_iphoneos-arm.deb'; ?>
<?PHP include("../../config.php");
$query = "SELECT stats FROM download WHERE filename = '".$debname."'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
echo $row[0];
}
?>
Sometimes, i update the packages and the name of the new package will be changed, for example: com.dev.package_2.1-1_iphoneos-arm.deb
This will then make the page display the counts of the new package which are reset to 0
Therefore, I'm trying to find a way to get the total number of downloads for all the versions
For example:
filename | stats
________________________________________|_________________
com.dev.package_1.0-1_iphoneos-arm.deb | 25
com.dev.package_2.1-1_iphoneos-arm.deb | 2
________________________________________|_________________
Total Downloads of com.dev.package | 27
So I want to display on my page the sum of the 2 file which is 27