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