Re: Creating Rows and Columns Using for() Loops

From: Date: Thu, 08 Jul 2004 23:54:02 +0000
Subject: Re: Creating Rows and Columns Using for() Loops
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190013@lists.php.net to get a copy of this message
On Thu, 8 Jul 2004 18:17:25 -0500, php-list@xenonsolutions.com <php-list@xenonsolutions.com> wrote: > for ($i = 0; $i < count($num_days); $i++) { [snip] > for ($j = 0; $j < 32; $j++) { [snip] > } [snip] > } > How do I fix it to where each date column has > exactly 32 rows of guest names? it looks like you need to set up your loops the other way around. right now your code is like this: for (columns) { for (rows) { } } you want: for (rows) { for (columns) { } } explained in english: you need to handle one row/person at a time and not one column/date at a time. on the other hand i'm not sure i totally understand your desired output, so maybe a quick ascii table would help me/us? chris.

« previous php.general (#190013) next »