Jump to content

My code problem


mattia

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...