Extension ext-coupon continued, a lot improvements applied:
[mailer.git] / inc / autopurge / purge-general.php
index 60831e688c151630cde3f89edd3b3a49aab4511a..30c18977e406b2e62e40ac4afdffd2be1ade0adf 100644 (file)
@@ -59,9 +59,9 @@ FROM
 LEFT JOIN
        `{?_MYSQL_PREFIX?}_payments` AS t
 ON
-       s.payment_id=t.id
+       s.`payment_id`=t.`id`
 WHERE
-       s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
+       (UNIX_TIMESTAMP() - s.`timestamp_ordered`) >= {?auto_purge?}
 ORDER BY
        s.userid ASC', __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {