You are here: Re: Adding number loop in a while statement « PHP SQL « IT news, forums, messages
Re: Adding number loop in a while statement

Posted by Rincewind on 09/28/12 11:28

On 4 Oct 2005 09:22:36 -0700, Steve wrote:

>> I have a page that outputs data about a tv show, all is working fine,
>> however when a query returns for example 14 results I want to be able to
>> output the number that corresponds to the position in the result, alongside
>> the details.
>
> Just before the while loop starts:
> $counter = 0;
>
> Immediately after the while loop starts:
> $counter++;
>
> Wherever you want to display the row number:
> "...<span>$counter</span>..."
>
> ---
> Steve

Thanks Steve that works fine, I had all the right bits, but couldn't for
the life of me work out where to put them.

 

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

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