You are here: Re: How can I change every second row? « PHP Programming Language « IT news, forums, messages
Re: How can I change every second row?

Posted by Nikola Veber on 06/25/05 20:30

Well, if you get the results with

while ($row = mysql_fetch_assoc($result)){}

you could have a integer variable defined before the loop

$x = 0;
while ($row = mysql_fetch_assoc($result)){
if ($x % 2 == 0) blue
else ...
}




madsgormlarsen@gmail.com wrote:
> Hi
>
> I am making a html table builder, and would like every second row to be
> blue. So for that purpose I need a number that changes on every
> iteration of a while loop, for exampel so that a value is 0 then 1 then
> 0 a so forth.
>
> Any suggestions ?
>
> Mads
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация