mattia Posted July 26, 2012 Report Share Posted July 26, 2012 Hi all i write this code for the SUM of a aircraft flight hours,for single pilot, from two mysql tables <?php $query = 'SELECT SUM(flighttime)FROM ( SELECT flighttime AS flighttime FROM '.TABLE_PREFIX.'pireps WHERE aircraft = 26 AND accepted = 1 AND pilotid = '.Auth::$userinfo->pilotid.' UNION ALL SELECT flighttime FROM '.TABLE_PREFIX.'pireps_OLD WHERE aircraft = 26 AND accepted = 1 AND pilotid = '.Auth::$userinfo->pilotid.' ) AS total'; $result=DB::get_row($query); { } ?> <?php echo Util::FormatDuration($result->total); ?> but dont work in the profile_stats.tpl can someone help me 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.