You're right - I can never remember exactly what the function names are. I might have been thinking of query_first_slave(), but if you don't have a master/slave db setup it won't matter.
Anyway, I think query_first will work because we added "WHERE reputation.userid = $userid", so along with the SUM and GROUP BY, you should only get one row back, the total reputation for that userid. You could check by executing the query directly (I would have checked but I don't have any test data for reputations).
|