fixed quoting of the table named "user"

This commit is contained in:
Brenda Wallace 2009-03-12 14:59:36 +13:00
parent 2fa6d42977
commit 896dbfaf67

View File

@ -57,9 +57,14 @@ class FeaturedUsersSection extends ProfileSection
$quoted[] = "'$nick'";
}
$table = "user";
if(common_config('db','quote_identifiers')) {
$table = '"' . $table . '"';
}
$qry = 'SELECT profile.* ' .
'FROM profile JOIN user on profile.id = user.id ' .
'WHERE user.nickname in (' . implode(',', $quoted) . ') ' .
'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' .
'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' .
'ORDER BY profile.created DESC ';
$limit = PROFILES_PER_SECTION + 1;