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 Steve on 10/07/56 11:28

> 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

 

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

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