0

To prevent fraud im looking to offset earnings by 5 days. I pay my users for leads every Friday, basically what i want to do is have the query only to include amounts past last Sunday or past 5 days basically.

This is the query currently in my payments file. $reports = mysql_query("SELECT SUM(rate) as total_earned FROMreportsWHEREstatus= '2' ANDpid= '".$row['id']."'");

I've been reading around here and i got the idea to use where date >= date('2015-12-25');

i have the dates stored as 2015-07-17 01:45:46 so im trying to basically compare the current date.

I tried adding WHERE date > ".date("Y-m-d H:i:s")." - INTERVAL 2 DAY which dont work.

user2002220
  • 115
  • 1
  • 1
  • 10

0 Answers0