Airport Database

How can I create a page with airport data?

For example:

Table with: Airport Name, Airport ICAO, Country, Latitude, Longitude, Fuel Price, Airline Schedules from or to the airport.

Hi! 

You can call the function, 

\<?php $airports = OperationsData::getAllAirports() /\* Above \<td\> You have to put it \*/ foreach($airports as $airport) /\* On \<td\> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin \*/ echo $airport-\>name; echo $airport-\>icao; ?\>
1 Like

Where you put this code?

On 13/2/2017 at 10:04 PM, mayconfdsm said:

Hi! 

You can call the function, 

<?php $airports = OperationsData::getAllAirports() /* Above <td> You have to put it */ foreach($airports as $airport) /* On <td> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin */ echo $airport->name; echo $airport->icao; ?>

I have the following error

Parse error : syntax error, unexpected ‘foreach’ (T_FOREACH) in  /home1/mcfilmsp/public_html/crewcenter/core/pages/aeropuertos.php  on line  4

32 minutes ago, joooseb said:

I have the following error

Parse error : syntax error, unexpected ‘foreach’ (T_FOREACH) in  /home1/mcfilmsp/public_html/crewcenter/core/pages/aeropuertos.php  on line  4

Sorry, I’ve forgot { } 

<?php
$airports = OperationsData::getAllAirports(){
  /* Above <td> You have to put it */
foreach($airports as $airport)
  /* On <td> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin */
echo $airport->name;  
echo $airport->icao;   

}
?>

11 hours ago, mayconfdsm said:

Sorry, I’ve forgot { } 

<?php $airports = OperationsData::getAllAirports(){ /* Above <td> You have to put it */ foreach($airports as $airport) /* On <td> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin */ echo $airport->name; echo $airport->icao; } ?>

It doesn’t works

I want to put in a simple page (/index.php/pages/aeropuertos) but now the error is:

Parse error : syntax error, unexpected ‘{’ in  /home1/mcfilmsp/public_html/crewcenter/core/pages/aeropuertos.php  on line  2

Forgot a {

\<?php $airports = OperationsData::getAllAirports(){ /\* Above \<td\> You have to put it \*/ foreach($airports as $airport) { /\* On \<td\> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin \*/ echo $airport-\>name; echo $airport-\>icao; } ?\>

 

10 hours ago, web541 said:

Forgot a {

<?php $airports = OperationsData::getAllAirports(){ /* Above <td> You have to put it */ foreach($airports as $airport) { /* On <td> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin */ echo $airport->name; echo $airport->icao; } ?>

 

Same error

Parse error : syntax error, unexpected ‘{’ in  /home1/mcfilmsp/public_html/crewcenter/core/pages/aeropuertos.php  on line  2

\<?php $airports = OperationsData::getAllAirports(); /\* Above \<td\> You have to put it \*/ foreach($airports as $airport) { /\* On \<td\> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin \*/ echo $airport-\>name; echo $airport-\>icao; } ?\>

Yeah the dev put it the wrong spot to begin with

 

On 21/2/2017 at 5:11 PM, web541 said:

<?php $airports = OperationsData::getAllAirports(); /* Above <td> You have to put it */ foreach($airports as $airport) { /* On <td> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin */ echo $airport->name; echo $airport->icao; } ?>

Yeah the dev put it the wrong spot to begin with

 

Now it works!! thanks you so much