Moderators ProSkyDesign Posted February 12, 2017 Moderators Report Share Posted February 12, 2017 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. Quote Link to comment Share on other sites More sharing options...
mayconfdsm Posted February 14, 2017 Report Share Posted February 14, 2017 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 Quote Link to comment Share on other sites More sharing options...
OmerAslan Posted February 14, 2017 Report Share Posted February 14, 2017 Where you put this code? Quote Link to comment Share on other sites More sharing options...
Moderators ProSkyDesign Posted February 20, 2017 Author Moderators Report Share Posted February 20, 2017 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 Quote Link to comment Share on other sites More sharing options...
mayconfdsm Posted February 20, 2017 Report Share Posted February 20, 2017 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; } ?> Quote Link to comment Share on other sites More sharing options...
Moderators ProSkyDesign Posted February 20, 2017 Author Moderators Report Share Posted February 20, 2017 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 Quote Link to comment Share on other sites More sharing options...
web541 Posted February 20, 2017 Report Share Posted February 20, 2017 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; } ?> Quote Link to comment Share on other sites More sharing options...
Moderators ProSkyDesign Posted February 21, 2017 Author Moderators Report Share Posted February 21, 2017 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 Quote Link to comment Share on other sites More sharing options...
web541 Posted February 21, 2017 Report Share Posted February 21, 2017 <?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 Quote Link to comment Share on other sites More sharing options...
Moderators ProSkyDesign Posted February 23, 2017 Author Moderators Report Share Posted February 23, 2017 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 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.