Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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!

Reply With Quote
  #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
Reply With Quote
  #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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.