You are here: Re: PHP / Mysql - Retreive "Next" Row data in "this" row « PHP Programming Language « IT news, forums, messages
Re: PHP / Mysql - Retreive "Next" Row data in "this" row

Posted by Toby Inkster on 01/04/07 15:10

bill wrote:

> Shouldn't there be a bracket after the while statement ?

Not needed.

while (x) y;

is equivalent to:

while (x)
{
y;
}

You only need to use curly brackets after while() if you want to iterate
over more than one line, like this:

while (x)
{
y;
z;
}

The same is true of if(), elseif(), else, for(), foreach() and probably
others that I'm forgetting.

For example:

<?php
$countTo99 = rand(0,1);
if ($countTo99)
for ($i=0;$i<10;$i++)
for ($j=0;$j<10;$j++)
print "{$i}{$j}\n";
else
print "I decided not to count.\n";
?>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация