$content = merge_array($content, $data);
// Default for referral level > 0
- $depth = 'p.`ref_depth`=%s';
+ $depth = '`p`.`ref_depth`=%s';
if (is_null($content['level'])) {
- $depth = 'p.`ref_depth` IS NULL';
+ $depth = '`p`.`ref_depth` IS NULL';
} // END - if
// Load referral points
$result_points = SQL_QUERY_ESC('SELECT
' . getAllPointColumns('p.', ',') . '
- r.`counter`
+ `r`.`counter`
FROM
- `{?_MYSQL_PREFIX?}_user_points` AS p
+ `{?_MYSQL_PREFIX?}_user_points` AS `p`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_refsystem` AS r
+ `{?_MYSQL_PREFIX?}_refsystem` AS `r`
ON
- p.`userid`=r.`userid` AND
- p.`ref_depth`=r.`level`
+ `p`.`userid`=`r`.`userid` AND
+ `p`.`ref_depth`=`r`.`level`
WHERE
- p.`userid`=%s AND
+ `p`.`userid`=%s AND
' . $depth . '
LIMIT 1',
array(