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'"; $quoted[] = "'$nick'";
} }
$table = "user";
if(common_config('db','quote_identifiers')) {
$table = '"' . $table . '"';
}
$qry = 'SELECT profile.* ' . $qry = 'SELECT profile.* ' .
'FROM profile JOIN user on profile.id = user.id ' . 'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' .
'WHERE user.nickname in (' . implode(',', $quoted) . ') ' . 'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' .
'ORDER BY profile.created DESC '; 'ORDER BY profile.created DESC ';
$limit = PROFILES_PER_SECTION + 1; $limit = PROFILES_PER_SECTION + 1;