Hello, I only use payflow_pro plugin and every day at midnight my members get rebilled. I would like to add code to the end of the file so I can get an email how much was rebilled. Here is the code I came up with, but it doesn't work: PHP: $beg_tm = date('Y-m-d 00:00:00', time()); $q = $db->query("SELECT sum(amount) FROM amember_payments WHERE completed > 0 AND tm_completed > '$beg_tm'"); $query_data=mysql_fetch_array($q); $total=$query_data["sum(amount)"]; echo $total; That is the part I am having trouble with. I know how to email the results.. Any help figuring this out is appreciated!
Hello, I suspect the "AND tm_completed > '$beg_tm'" part of your db query is never evaluated to TRUE. I would think you would need to subtract $beg_tm by (3600 *24) so that you would pick up the products/subscribtions that were rebilled in the last 24 hours. You would also need to track current time also. So maybe something like the following if your trying to track products rebilled in last 24 hours: PHP: $beg_tm = date('Y-m-d 00:00:00', time()-3600*24); $end_tm = date('Y-m-d 23:59:59', time()); $q = $db->query("SELECT sum(amount) FROM amember_payments WHERE tm_completed BETWEEN '$beg_tm' AND '$end_tm'"); $query_data=mysql_fetch_array($q); $total=$query_data["sum(amount)"]; echo $total;