correct method for querying

darcs-hash:20081112181327-5ed1f-b9703dc936c8d99b226055053b02e4ba177b240d.gz
This commit is contained in:
Evan Prodromou 2008-11-12 13:13:27 -05:00
parent b3ed4e5e20
commit 52431fa58b
1 changed files with 5 additions and 5 deletions

View File

@ -37,9 +37,9 @@ $cnt = $user->find();
while ($user->fetch()) {
common_log(LOG_INFO, 'Updating inbox for user ' . $user->id);
$inbox = new Notice_inbox();
$inbox->qry('INSERT INTO notice_inbox (user_id, notice_id, created) ' .
'SELECT ' . $user->id . ', notice.id, notice.created ' .
'FROM subscription JOIN notice ON subscription.subscribed = notice.profile_id ' .
'WHERE subscription.subscriber = ' . $user->id . ' ' .
'AND notice.created >= subscription.created');
$inbox->query('INSERT INTO notice_inbox (user_id, notice_id, created) ' .
'SELECT ' . $user->id . ', notice.id, notice.created ' .
'FROM subscription JOIN notice ON subscription.subscribed = notice.profile_id ' .
'WHERE subscription.subscriber = ' . $user->id . ' ' .
'AND notice.created >= subscription.created');
}