-// 0 1 2 3 4 5 6 7 8
-$result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp_ordered, max_rec, timestamp_send, clicks
-FROM `{!_MYSQL_PREFIX!}_user_stats`
-WHERE userid=%s
-ORDER BY timestamp_ordered DESC",
- array(getUserId()), __FILE__, __LINE__);
-
-if (SQL_NUMROWS($result) > 0) {
+$result = SQL_QUERY_ESC("SELECT
+ `id`, `cat_id`, `payment_id`, `subject`, `url`, `timestamp_ordered`, `max_rec`, `timestamp_send`, `clicks`
+FROM
+ `{?_MYSQL_PREFIX?}_user_stats`
+WHERE
+ `userid`=%s
+ORDER BY
+ `timestamp_ordered` DESC",
+ array(getMemberId()), __FILE__, __LINE__);
+
+if (!SQL_HASZERONUMS($result)) {