View Single Post
Old 02-05-2013, 07:22 PM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,172
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I don't think you really need much more from me. And as I said, I don't use PHP, so I'm likely not the best person to ask.

Clearly you need to make two SQL queries per HTML page: One to get the airport info (runway length, full airport name, etc., etc.) and then a separate one for the restaurants.

And of course the one for the airport info will *NOT* be in a while loop, since there will be only one record, so you probably want to just do
Code:
if ( ! $result ) 
{
     echo "Could not find ICAO designation $query";
     exit( );
}
$row = mysql_fetch_assoc( $result );
if ( ! $row ) 
{
    echo "?? what went wrong?  got result but no data?";
    exit( );
}
... use $row["fieldNames"] to display airport info ...
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote