Index: trunk/extensions/ContributionReporting/ContributionReporting.php |
— | — | @@ -214,8 +214,6 @@ |
215 | 215 | function efContributionReportingTotal( $fundraiser, $fudgeFactor = 0 ) { |
216 | 216 | global $wgMemc, $egFundraiserStatisticsFundraisers, $egFundraiserStatisticsCacheTimeout; |
217 | 217 | |
218 | | - $dbr = efContributionReportingConnection(); |
219 | | - |
220 | 218 | // If a total is cached, use that |
221 | 219 | $key = wfMemcKey( 'contributionreportingtotal', $fundraiser, $fudgeFactor ); |
222 | 220 | $cache = $wgMemc->get( $key ); |
— | — | @@ -223,6 +221,8 @@ |
224 | 222 | return $cache; |
225 | 223 | } |
226 | 224 | |
| 225 | + $dbr = efContributionReportingConnection(); |
| 226 | + |
227 | 227 | // Find the index number for the requested fundraiser |
228 | 228 | $myFundraiserIndex = false; |
229 | 229 | foreach ( $egFundraiserStatisticsFundraisers as $fundraiserIndex => $fundraiserArray ) { |
— | — | @@ -242,7 +242,7 @@ |
243 | 243 | $result = $dbr->select( |
244 | 244 | 'public_reporting_fundraisers', |
245 | 245 | 'round( prf_total ) AS total', |
246 | | - 'prf_id = ' . $myFundraiser['id'], |
| 246 | + 'prf_id' => $myFundraiser['id'], |
247 | 247 | __METHOD__ |
248 | 248 | ); |
249 | 249 | $row = $dbr->fetchRow( $result ); |