View Single Post
  #1 (permalink)  
Old November 24th, 2004, 12:58 PM
IP076 IP076 is offline
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to IP076
Default Newbie...probably a simple question...variables

$conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS)
 or die('Could not connect to MySQL database. ' . mysql_error());
mysql_select_db(SQL_DB,$conn);

$query = "SELECT airport_id FROM tblairports WHERE airportstate = 'az' ORDER BY airportstate, airport_id";
$results = mysql_query($query) or die(mysql_error());

while ($rows=mysql_fetch_array($results)) {
    extract($rows);
    echo $airport_id . " ";}

I'm using the above to access a database. My connection works great, as the last echo returns the value's I want.

What I would like to do is be able to include those values in a variable. I was hoping something like $arizona = echo $airport_id . " "; would work, but it doesnt appear to. Anyone have any idea as to how I go about turning that last echo statement into a variable.

The variable will then be passed on to a NWS site and retrieve weather for all the airports. I have done this successfully, I just cant seem to get the variable to work right.

Thanks!

Reply With Quote