Hello
I'm looping a query to get the file size (bytes) from a number of images stored in a database:
$result = mysql_query("SELECT * FROM $images_db WHERE username='$session_username' ORDER BY filename DESC ",$db);
{ if ($myrow = mysql_fetch_array($result))
{ do {
$file = $myrow["filename"];
$complete="../images/$file";
$filesize = filesize("$complete");
printf("(%s)",$filesize);
} while ($myrow = mysql_fetch_array($result)); } else {echo "NO IMAGES AVAILABLE";
}
}
Which shows (2057)(2059)(1997).
I now want to add all of the 'filesize' found together and print the total, how can I add all these values together to get a total (6113). Any help would be much appreciated.
Cheers John