Index: trunk/extensions/UsabilityInitiative/UserDailyContribs/UserDailyContribs.hooks.php |
— | — | @@ -39,9 +39,9 @@ |
40 | 40 | $today = gmdate( 'Ymd', time() ); |
41 | 41 | $dbw = wfGetDB( DB_MASTER ); |
42 | 42 | |
43 | | - //normal $db->update doesn't support SQL variables yet |
44 | | - $sql = "UPDATE user_daily_contribs SET contribs=contribs+1 WHERE day = $today AND user_id = {$wgUser->getId()}"; |
45 | | - $dbw->query($sql, __METHOD__); |
| 43 | + $dbw->update( 'user_daily_contribs', array( 'contribs=contribs+1' ), |
| 44 | + array( 'day' => $today, 'user_id' => $wgUser->getId() ), |
| 45 | + __METHOD__ ); |
46 | 46 | |
47 | 47 | if($dbw->affectedRows() == 0){ |
48 | 48 | $dbw->insert("user_daily_contribs", array("user_id" => $wgUser->getId(), "day" => $today, "contribs" => 1), __METHOD__); |