// Fetch right stats_id from pool
$result_pool = SQL_QUERY_ESC("SELECT
- s.id
+ s.`id`
FROM
- `{?_MYSQL_PREFIX?}_user_stats` AS s
+ `{?_MYSQL_PREFIX?}_user_stats` AS `s`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_pool` AS p
+ `{?_MYSQL_PREFIX?}_pool` AS `p`
ON
- s.pool_id=p.id
+ s.`pool_id`=`p`.`id`
WHERE
s.`pool_id`=%s
LIMIT 1",