summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/classes/User.php b/classes/User.php
index b1bae8835..b1c061c18 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -338,11 +338,12 @@ class User extends Memcached_DataObject
{
# 3-way join; probably should get cached
- $qry = 'SELECT user.* ' .
- 'FROM subscription sub1 JOIN user ON sub1.subscribed = user.id ' .
- 'JOIN subscription sub2 ON user.id = sub2.subscriber ' .
+ $UT = common_config('db','type')=='pgsql'?'"user"':'user';
+ $qry = "SELECT $UT.* " .
+ "FROM subscription sub1 JOIN $UT ON sub1.subscribed = $UT.id " .
+ "JOIN subscription sub2 ON $UT.id = sub2.subscriber " .
'WHERE sub1.subscriber = %d and sub2.subscribed = %d ' .
- 'ORDER BY user.nickname';
+ "ORDER BY $UT.nickname";
$user = new User();
$user->query(sprintf($qry, $this->id, $this->id));