AFVA | Mitchell Posted July 9, 2010 Report Share Posted July 9, 2010 I'm working one of the new features for WorldACARS that pulls aircraft data from the database, displays it, gets processed by WorldACARS then displays it to the user. For some reason the code I wrote doesn't work: (It pulls data from url, e.g http://localhost/action.php/wacars/maintence?reg=VH-FTW) public function maintence() { $reg = $_GET['reg']; $aicraft = self::getAircraftInfo($reg); echo "$aicraft->totaltime"; } public static function getAircraftInfo($reg) { $reg = DB::escape($reg); return DB::get_row('SELECT * FROM '.TABLE_PREFIX.'aircraft WHERE `registration`='.$reg); } Could someone please tell me whats wrong with it? Thanks, Mitch Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted July 9, 2010 Administrators Report Share Posted July 9, 2010 You should be using $this->get->reg Also, you don't need static, you can just call it using $this->getAircraftInfo(). Though you should call the API OperationsData::getAircraftInfo() Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted July 11, 2010 Author Report Share Posted July 11, 2010 I am still getting a blank page... Does the OperationsData::getAircraftInfo($id) $id mean the registration or the actual aircraft id (1,2,3 etc.). WorldACARS sends the data as the registration of the aircraft and not the numeric ID. Updated Code: public function maintence() { $reg = $this->get->reg; $aircraft = $this->getAircraftInfo($reg); echo "$aicraft->totaltime"; } Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted July 11, 2010 Administrators Report Share Posted July 11, 2010 You'd use this: http://docs.phpvms.net/api/codon_core/OperationsData.html#getAircraftByReg 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.