$sql = '';
foreach (runFilterChain('locked_points_columns_array', array('points')) as $column) {
// Add it with/-out locked
- $sql .= 'p.`' . $column . '` + p.`locked_' . $column . '` +';
+ $sql .= '`p`.`' . $column . '` + `p`.`locked_' . $column . '` +';
} // END - foreach
// Remove last plus
// Run the query to obtain all user's amounts (regardless of their status)
$result = SQL_QUERY('SELECT
- p.`userid`,
+ `p`.`userid`,
SUM(
' . $sql . ' -
- d.`used_points`
+ `d`.`used_points`
) AS `points`
FROM
`{?_MYSQL_PREFIX?}_user_points` AS `p`
INNER JOIN
`{?_MYSQL_PREFIX?}_user_data` AS `d`
ON
- d.`userid`=p.`userid`
+ `d`.`userid`=`p`.`userid`
GROUP BY
- p.`userid`
+ `p`.`userid`
ORDER BY
- p.`userid` ASC', __FILE__, __LINE__);
+ `p`.`userid` ASC', __FILE__, __LINE__);
// Are there entries? (sorry, the XML functions cannot "produce" the above SQL statement)
if (!SQL_HASZERONUMS($result)) {