- $result_main = SQL_QUERY_ESC("SELECT gender, surname, family, email, remote_addr, sponsor_created, points_amount, refid
-FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE status='PENDING' AND id='%s' LIMIT 1",
- array($id), __FILE__, __LINE__);
- $refid = 0;
+ $result_main = SQL_QUERY_ESC("SELECT
+ `id`, `gender`, `surname`, `family`, `email`, `remote_addr`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+ `points_amount`, `points_used`,
+ (`points_amount` + `points_used`) AS `points`,
+ `refid`
+FROM
+ `{?_MYSQL_PREFIX?}_sponsor_data`
+WHERE
+ `status` IN('PENDING','UNCONFIRMED') AND
+ `id`=%s
+LIMIT 1",
+ array($content['id']), __FILE__, __LINE__);
+
+ // Is there an entry?