- $result = SQL_QUERY_ESC("SELECT DISTINCT d.gender, d.surname, d.family, b.level, b.points
-FROM `{!_MYSQL_PREFIX!}_user_data` AS d
-RIGHT JOIN `{!_MYSQL_PREFIX!}_bonus_turbo` AS b
-ON d.userid=b.userid
-WHERE d.`status`='CONFIRMED' AND d.userid=%s AND b.%s=%s
+ $result = SQL_QUERY_ESC("SELECT
+ d.`userid`, b.`level`, b.`points`
+FROM
+ `{?_MYSQL_PREFIX?}_user_data` AS d
+INNER JOIN
+ `{?_MYSQL_PREFIX?}_bonus_turbo` AS b
+ON
+ d.`userid`=b.`userid`
+WHERE
+ d.`status`='CONFIRMED' AND
+ d.`userid`=%s AND
+ b.`%s`=%s