Jump to content

Calculation help


steviez

Recommended Posts

Hi,

 

I am working on a new feature for my download site where users will get a certain ammount of cash per 1000 download of a file

 

how can i make it so that the cash ammount only gets added every 1000 downloads?

 

for example $6 per 1000 downloads

 

So far my code looks like:

if($file['file_size'] >= 5242880 && $file['downloads'] >= 1000)
			 {
				 // update database and add earnings
				 mysql_query("UPDATE uploads SET earnings = earnings+".$config['file_earnings_5_50']." WHERE file_id = '".$file['file_id']."'");
			 }

 

Any help would be great!

 

Link to comment
https://forums.phpfreaks.com/topic/200597-calculation-help/
Share on other sites

  • 3 weeks later...

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.