Jump to content

need help on coding some php to acces database


moeschkieto

Recommended Posts

hello

 

i am trying to let a page show some data out of a database.

this is how it schould look

vraag.png

but i can't get it to work

here are the code's that i got

$allaircraft = OperationsData::GetAllAircraft();
echo '<table>';

foreach ($allaircraft as $aircraft)
{
echo '<tr>';
echo '<td>';
// do each row
echo '</td></tr>';
}

echo '</table>';

 

and the folowing

public static function GetAllAircraft($onlyenabled=false)
         {
                 $sql = 'SELECT * 
                               FROM ' . TABLE_PREFIX .'aircraft';
                                         
                 if($onlyenabled == true)
                 {
                         $sql .= ' WHERE `enabled`=1 ';
                }
                
                 $sql .= ' ORDER BY icao ASC';
                
                 return DB::get_results($sql);
        }

on this website you can see whate i mean

http://www.newenglandvirtual.com/index.php/Operations/fleet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.