Jump to content

[SOLVED] help with code


steviez

Recommended Posts

Are you storing the individual file attributes (filesize, name, path, etc) in the database? That would be the wisest and easiest way to go. With that, you could simply query your database for the SUM() of all their filesizes, and you would be able to know exactly what had been used and is available.

Link to comment
https://forums.phpfreaks.com/topic/45606-solved-help-with-code/#findComment-221488
Share on other sites

If you have the filesize stored in the table along with who it belongs to, you can run a SUM() query to get the total filesize of all their files. Somthing like this may be what you're after:

<?php
$sql = mysql_query("SELECT SUM(filesize) AS total, userID FROM myFileTable GROUP BY userID");
?>

 

That query will give you the total filesize of all users tied to their userID. Of course, you'll have to provide your own table names and column names, but the principle is there.

Link to comment
https://forums.phpfreaks.com/topic/45606-solved-help-with-code/#findComment-221526
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.