Dave M G wrote:
> Nicolas, Jochem, Tul,
>
> I have been going mental, reading the online manual and trying different
> things. I can not get this loop to work.
>
> Please understand that I have endeavored to read up on list(), each(),
> foreach(), while(). key(), and everything else I can. I've e
Nicolas, Jochem, Tul,
I have been going mental, reading the online manual and trying different
things. I can not get this loop to work.
Please understand that I have endeavored to read up on list(), each(),
foreach(), while(). key(), and everything else I can. I've even looked
at online tuto
Dave M G wrote:
Jochem, Tul, Nicolas,
Thank you for your help.
I must be doing something wrong with how my array is generated. It's
actually just a MySQL result, but because it is returned from a
function, it does not seem to behave as I would expect a MySQL result
should.
I'm trying the f
Jochem, Tul, Nicolas,
Thank you for your help.
I must be doing something wrong with how my array is generated. It's
actually just a MySQL result, but because it is returned from a
function, it does not seem to behave as I would expect a MySQL result
should.
I'm trying the foreach function a
Dave M G wrote:
> PHP List,
>
> Very frequently I use mysql_fetch_row in a while statement to
>
> while($variable = mysql_fetch_row($mysqlResult)){
> echo $variable[text1];
> echo $variable[text2];
another thing. $variable[text2] is bad because you very likely don't
have a constant in your code
the foreach loop is probably better (it doesn't require
reset()ing the array pointer for instance) but you should also
look at the example on this page (using the current() function in a
while loop):
http://php.net/key
Dave M G wrote:
> PHP List,
>
> Very frequently I use mysql_fetch_ro
Dave M G a écrit :
PHP List,
Pretty standard.
But what do I do when I want to do the same kind of while loop not
with a MySQL result, but with just a regular array?
while (variable = ($array)){
echo $variable[text1];
echo $variable[text2];
}
did you try something like this ?
foreach ($
PHP List,
Very frequently I use mysql_fetch_row in a while statement to
while($variable = mysql_fetch_row($mysqlResult)){
echo $variable[text1];
echo $variable[text2];
}
Pretty standard.
But what do I do when I want to do the same kind of while loop not with
a MySQL result, but with just a re
8 matches
Mail list logo