AFVA | Mitchell Posted September 4, 2010 Report Posted September 4, 2010 I want to modify: public static function getAircraftInfo($reg) { $reg = DB::escape($reg); return DB::get_row('SELECT * FROM '.TABLE_PREFIX.'aircraft WHERE `registration` ='.$reg ); } so it will return the hours as well.. I have no idea how I am going to this so can someone please provide the code. Thanks, Mitch Quote
Administrators simpilot Posted September 4, 2010 Administrators Report Posted September 4, 2010 There is no record for total flight hours for an aircraft in the aircraft table, or anywhere else. You will need to create a sql call to the pireps table to get the total hours for an aircraft. Something like -> public function get_AircraftHours($id) { $query = 'SELECT SUM(flighttime) AS total FROM '.TABLE_PREFIX."pireps WHERE aircraft='$id'"; $result = DB::get_row($query); return $result->total; } The "$id" variable has to be the database id of the aircraft, not the registration as it is recorded that way in the pireps table. Quote
Administrators Nabeel Posted September 6, 2010 Administrators Report Posted September 6, 2010 There's a function which does that already in statsdata Quote
Administrators simpilot Posted September 6, 2010 Administrators Report Posted September 6, 2010 There's a function which does that already in statsdata Sorry, but I don't see it.... Quote
Administrators Nabeel Posted September 9, 2010 Administrators Report Posted September 9, 2010 http://docs.phpvms.net/api/codon_core/StatsData.html#AircraftUsage http://github.com/ns....class.php#L325 Quote
Administrators simpilot Posted September 10, 2010 Administrators Report Posted September 10, 2010 Ah, I see said the blind man. 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.