ok so im writing a file management system, that allows members to upload files, each member is assigned a user level which has a specific Quota of space on the server, what i need my script to do is show the total amount of space currently used.
my databases are constructed as follows:
MF_Members:
| ID | UName | PWord | ULevel | Regcode |
| 01 | tester | MD5() | 1 | unique md5() |
MF_Lvls
| ID | Quota |
| 01 | xBytes|
| 02 | xBytes|
MF_Files
| ID | Filename | Size | Usercode | Access |
| 01 | test.zip | 1024 | Regcode | P |
Usercode is what ties a file to a user, Usercode == user Regcode
Access is what defines a public file to a private file.
so bassicaly i need my script to show the logged in user their quota used and their quota left.
so it would be a case of getting the userlevel checking teh quota for that user level, then adding the total of all the users files sizes and subtracting them from the user level quota, i could right a long list of queries to do this but they probly would be all that efficient so what would the most efficient way iof doing this?