September 25, 200817 yr I am in desperate need of some help. I run Alaska Adventures - http://www.flyaka.comI use FSACARS and my totla hours is stuck on 838:59:59. Any help would be appreciated or if someone can share there total hours script. I have tried to get help from the FSACARS site with no luck. There forums are pretty much dead. Here is how my total hours script written. If you go to my site and look at the stats on the left you will see what I'm talking about. <?php /* Constants */ @define ("MYSQL_CONNECT_INCLUDE", "connect_db.php"); // MySQL database connection /* Database connection */ include(MYSQL_CONNECT_INCLUDE); $query = "SELECT SEC_TO_TIME( SUM( TIME_TO_SEC(reports.duration))) AS SUM_OF_duration FROM reports"; $result = mysql_query($query) or die('0'); $data = mysql_fetch_row($result); $sum = $data[0]; echo("$sum"); php?>http://www.flyaka.com/ACARS/hours.phpEddie
September 28, 200817 yr Hey Eddie,Sorry I can't help but you can try Flightsim World Forums, I think you'll be able to get assistance there from someone who's handy with FSACARS.Monte
October 8, 200817 yr Eddie:I had the same problem and was informed that the sec_to_time function returns a maximum value of 838:59:59. Apparently it is mentioned somewhere in the SQL documentation. Here is a section of my code that determines total hours. It should be easy to modify for your purposes:$query="SELECT a.pilot_id AS Pilot_id, a.pilot_num AS Pilot, a.name AS Name, c.airport_name AS HUB, a.vatsim_id AS VATSIM, sum(time_to_sec(b.duration)) AS Duration FROM pilots AS a, reports AS b, airports AS c WHERE a.pilot_id = b.pilot_id AND a.hub = c.airport_code GROUP BY Pilot_id, Pilot, Name, HUB, VATSIM ORDER BY Pilot LIMIT 1000"; $result=mysql_query($query) or die(mysql_error()); while($pr=mysql_fetch_array($result,MYSQL_NUM)) { // Reformat duration $a=intval($pr[5] / 3600); $b=$pr[5] - ($a * 3600); $c=intval($b / 60); $hrs=$a; $mins=$c; $tot_time=$hrs . " Hrs " . $mins . " Mins";--Tom________[a href=http://www.corpairamerica.com]http://mysite.verizon.net/tjrush/tjrcaasig.jpg[/a] Tom
Create an account or sign in to comment