Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #11163
| From | Derek Turner <frderek@cesmail.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Will this work? |
| Date | 2011-02-07 23:03 +0000 |
| Message-ID | <8rbc1jFh6iU2@mid.individual.net> (permalink) |
How long and complicated can a while condition be?
I want to:
define a string variable ($i) starting at "01"
use this in a mysql query
increment the string
dropout of the while when a zero result comes back from mysql
So, would something like:
while ($sql="some multi-lined mysql query containing $i twice" &&
$result=mysql($conn, $sql)){
do some stuff including incrementing $i;
}
presumably the first condition will always return true, will the second
return false if no matches are found? Can a while condition run over
several lines like this? The manual doesn't seem to say.
Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread
Will this work? Derek Turner <frderek@cesmail.net> - 2011-02-07 23:03 +0000
Re: Will this work? Denis McMahon <denis.m.f.mcmahon@googlemail.com> - 2011-02-08 01:27 +0000
Re: Will this work? Derek Turner <frderek@cesmail.net> - 2011-02-08 13:06 +0000
Re: Will this work? Jerry Stuckle <jstucklex@attglobal.net> - 2011-02-08 08:36 -0500
csiph-web