Moderators Parkho Posted September 15, 2012 Moderators Report Share Posted September 15, 2012 Hi there, I'm trying to get sum of revenue for a pilot's all PIREPS, so here is the function: public static function totalrev($pilotid) { $sql = 'SELECT pilotid, SUM(revenue) FROM '.TABLE_PREFIX.'pireps WHERE pilotid='.intval($pilotid).' GROUP by '.$pilotid ; return DB::get_results($sql); } And I have the following in my .tpl file: $pilotid = Auth::$userinfo->pilotid ; $row = PIREPData::totalrev($pilotid); echo FinanceData::formatMoney($row); And I get nothing. please help me find out where I'm wrong. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.