- $result = SQL_QUERY("SELECT DISTINCT m.id, m.admin_id, a.login, m.mail_template
-FROM `{!_MYSQL_PREFIX!}_admins_mails` AS m
-LEFT JOIN `{!_MYSQL_PREFIX!}_admins` AS a
-ON m.admin_id=a.id
-WHERE (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != ''
-ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT
+ m.id, m.admin_id, a.login, m.mail_template
+FROM
+ `{?_MYSQL_PREFIX?}_admins_mails` AS m
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_admins` AS a
+ON
+ m.admin_id=a.id
+WHERE
+ (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != ''
+ORDER BY
+ m.admin_id ASC,
+ m.mail_template ASC", __FILE__, __LINE__);