add quotes around table named "user" when quote_identifiers is true

This commit is contained in:
Brenda Wallace 2009-07-15 20:23:52 +12:00
parent 3722b90a27
commit 788dd66dbe

View File

@ -896,10 +896,14 @@ class Notice extends Memcached_DataObject
{
$user = new User();
if(common_config('db','quote_identifiers'))
$user_table = '"user"';
else $user_table = 'user';
$qry =
'SELECT id ' .
'FROM user JOIN subscription '.
'ON user.id = subscription.subscriber ' .
'FROM '. $user_table .' JOIN subscription '.
'ON '. $user_table .'.id = subscription.subscriber ' .
'WHERE subscription.subscribed = %d ';
$user->query(sprintf($qry, $this->profile_id));