Re: loop in horizontal direction (php-html)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, August 10, 2006 8:32 am, Reinhart Viane wrote:
> I've been wondering.
> I know it's possible to make a php loop that each time generates a new
> <tr>.
> In that case the results are stored under eachother.
> Now I want to know if I can do the same in a horizontal direction.
>
> The result should be something like this, I loop through available
> projects:
>
> 	Project1	Project2 	Project3 	Project4	...

$item_count = 0;
while (... = mysql_result($result)){
  if (($item_count % 5) == 0) echo "<tr>\n";
  $item_count++;

echo "<td>$project_id</td>\n";
> 1	45		89		5		8


  if (($item_count % 5) == 4) echo "</tr>\n";

}

> 2	23		9		65		31
> 3	23		91		55		73
> 4	11		90		82		38
>
>
> The first column is fixed, but I have an unkown amount of projects
>
> Hope this aint to much html related.
>
> Thanks in advance,
> Reinhart Viane
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux