Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 24th, 2004, 12:58 PM
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!

  #2 (permalink)  
Old November 30th, 2004, 01:10 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

echo='echo $airport_id . " ";'

Christian
  #3 (permalink)  
Old November 30th, 2004, 03:24 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Why don't you just add a line that sets the variable to the value?

-Snib - http://www.snibworks.com
Where will you be in 100 years?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Question sionfx VS.NET 2002/2003 0 November 16th, 2006 03:32 PM
Newbie question savoym JSP Basics 1 August 16th, 2006 03:15 AM
C# Newbie Question jazzcatone ASP.NET 2.0 Basics 1 May 25th, 2006 10:18 PM
Simple 'passing variables between forms' issue... overture C# 4 October 14th, 2005 02:30 PM
HELP - C# newbie question on variables & propertie savoym C# 6 February 6th, 2004 03:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.