How to make this script output: 1,2,3,4,5,6,7..35,36?
Thanks.
crashomon
7:09 pm on May 12, 2005 (gmt 0)
please clarify, your question doesn't make sense. Are you trying to add the two loops together and have them display as one line? or are you trying to show the sum of the two loops?
macdar
7:25 pm on May 12, 2005 (gmt 0)
I'm sorry about that. I tried to simplify that example as much as I could. I've got some sql queries implemented in that script. What I need to do is to get the sum of these iterations step by step.
for($i=1; $i<10; $i++){ echo $i; for($j=1; $j<5; $j++){ //echo $j; $q = "update table set wizard= '$wizard' where id = '$k'; } }
where $k is 1,2,3,..36 (4*9).
Does it make sense now?
Thanks.
py9jmas
7:46 pm on May 12, 2005 (gmt 0)
Is there any reason why
for($i=1; $i<37; $i++){ echo $i; $q = "update table set wizard= '$wizard' where id = '$i'; }
wouldn't work?
macdar
7:56 pm on May 12, 2005 (gmt 0)
Yes, that would be to easy..:)
The first loop takes results from DB..
the second one bases on a reglar expression function: