- $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points AS points
-FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='CONFIRMED'".$whereStatement1." AND beg_points > 0
-ORDER BY beg_points DESC, userid
-LIMIT %s",
- array($whereStatement2), __FILE__, __LINE__);
+ $result_main = SQL_QUERY("SELECT
+ `userid`, `email`, `gender`, `surname`, `family`, `beg_points` AS points
+FROM
+ `{?_MYSQL_PREFIX?}_user_data`
+WHERE
+ `status`='CONFIRMED'" . $whereStatement1 . " AND
+ `beg_points` > 0
+ORDER BY
+ `beg_points` DESC,
+ `userid` ASC
+LIMIT {?beg_ranks?}", __FILE__, __LINE__);