- // 0 1 2 3 4 5 6 7 8 9 10
- $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, html_msg FROM `{?_MYSQL_PREFIX?}_pool` WHERE `data_type`='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
-} else {
- // 0 1 2 3 4 5 6 7 8 9 10
- $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, id FROM `{?_MYSQL_PREFIX?}_pool` WHERE `data_type`='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
-}
+ // With HTML mails
+ $HTML = ',`html_msg`';
+} // END - if
+
+// Main query
+$result_main = SQL_QUERY("SELECT
+ `id`,
+ `sender` AS `sender_userid`,
+ `subject`,
+ `text`,
+ `receivers`,
+ `payment_id`,
+ `timestamp`,
+ `url`,
+ `target_send`,
+ `cat_id`
+ ".$HTML."
+FROM
+ `{?_MYSQL_PREFIX?}_pool`
+WHERE
+ `data_type`='NEW'
+ORDER BY
+ `timestamp` DESC", __FILE__, __LINE__);