smokey68 Posted November 29, 2016 Report Posted November 29, 2016 What is the php code for showing how many active flight there are in number format EX : 3 Active Flights Quote
Moderators Parkho Posted November 29, 2016 Moderators Report Posted November 29, 2016 (edited) You would need a function to count ACARS data in ACARS data table like this: public static function countactiveflights() { $sql="SELECT * FROM phpvms_acarsdata WHERE lastupdate = date(now())"; $count = DB::get_results($sql); return count($count); } Now place this in "OperationsData.class.php" at the bottom before the closing bracket. Then you would call the function like this: <table> <tr> <td>Active Flights:</td> <td><?php echo OperationsData::countactiveflights(); ?> Active flights </td> </tr> </table> Edited November 29, 2016 by parkho Quote
smokey68 Posted July 11, 2018 Author Report Posted July 11, 2018 not working anymore when switched to 5.5 Quote
Moderators shakamonkey88 Posted July 11, 2018 Moderators Report Posted July 11, 2018 <?php echo ACARSData::getLiveFlightCount(); ?> Quote
smokey68 Posted July 13, 2018 Author Report Posted July 13, 2018 On 7/11/2018 at 3:34 PM, shakamonkey88 said: <?php echo ACARSData::getLiveFlightCount(); ?> Thanks, shakamonkey88 works great ! Quote
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.