-$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
-$total = 0;
-if (SQL_NUMROWS($result) > 0)
-{
+$result = SQL_QUERY('SELECT
+ `userid` AS `from_userid`,`to_userid`,`trans_id`,`points`,`reason`,`time_trans`
+FROM
+ `{?_MYSQL_PREFIX?}_user_transfers_out`
+ORDER BY
+ `trans_id` ASC', __FILE__, __LINE__);
+
+$total = '0';
+if (!SQL_HASZERONUMS($result)) {