Re: categorise list

From: Date: Mon, 09 Jun 2003 11:28:51 +0000
Subject: Re: categorise list
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150744@lists.php.net to get a copy of this message
$letter=''; $while($row=mysql_fetch_array($result)) { if($letter!=$row[name][0]) { echo $row[name][0].'<br>'; $letter=$row[name][0]; } echo $row[name].'<br>'; } Op maandag 09 juni 2003 12:41, schreef u: > I am dispalying data from mysql database using the codes below: > > $while($row=mysql_fetch_array($result)) > { > echo $row[name]; > } > > How can i format the above data in this format as shown below? in > alphabetical order > > A > --------------------------------------------------------------------------- >----------------------------click to go up Apple > Armchair > > B > --------------------------------------------------------------------------- >----------------------------click to go up Basket > Baseball > > C > --------------------------------------------------------------------------- >----------------------------click to go up Car > > > ............................ > and so on > > > any suggestions?? > > Many thanks, > awlad > > _______________________________________________________________________ > > Sheridan Phoenix Company > The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB > > Email: a.hussain@sheridan-phoenix.com > Phone: 01582 522 330 > Fax: 01582 522 328 > _______________________________________________________________________ > > This electronic transmission is strictly confidential and intended > solely for the addressee. If you are not the intended addressee, you > must not disclose, copy or take any action in reliance of this > transmission. If you have received this transmission in error it would > be helpful if you could notify The Sheridan Phoenix Company Ltd as soon > as possible. > > Any views expressed in this message are those of the individual sender, > except where the sender specifically states them to be the views of The > Sheridan Phoenix Company Ltd.

« previous php.general (#150744) next »