[thelist] PHP - While Loop

bruce bedouglas at earthlink.net
Thu Aug 14 11:11:32 CDT 2003


give us the "entire" test file that you have... 

you have given us a part... one of the issues you have is the trailing ";" 
with the 2nd echo...

post the entire php test code and i/we can help...


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Kath
Sent: Thursday, August 14, 2003 8:13 AM
To: thelist at lists.evolt.org
Subject: [thelist] PHP - While Loop

I'm just beginning to learn PHP using  PHP and MySQL Web Development by
Luke Welling and Laura Thomson.

I'm up to the Conditionals - While Loop section.  I opened an example they
have and it doesn't seem to work on my set up, though it does work if I
upload the file to my server.  I have an Apache/PHP 4.2.3/MySQL set up on
my Windows 2000 PC.

Here is the PHP code ...

$distance = 50;
while ($distance <= 250 )
  echo "<tr>\n  <td align='right'>$distance</td>\n";
  echo "  <td align='right'>". $distance / 10 ."</td>\n</tr>\n";
  $distance += 50; 

And this is the output on my PC ...

Distance Cost 
\n\n"; $distance += 50; } ?>  

I have no idea why it doesn't work in my testing environment.  Is there
something else I need on my system besides Apache/PHP 4.2.3/MySQL?

Is there more information I need to provide to more closely pinpoint the

I would love for the test environment to work so I don't have to keep
uploading these "learning" files to my web site.


Kath ...  "A patriot must always be ready to defend his country against its
government."  -Edward Abbey, naturalist and author (1927-1989)
Established 1995 --> www.cyber-kat.com

* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list