Hi, Thursday, November 20, 2003, 11:03:22 AM, you wrote: DP> I'm reading a list of stores from a database and ordering them DP> alphabetically. How would I place a line break in between each letter DP> grouping? For example,
DP> Applebee's DP> Aaron's Place DP> Aardvark Store DP> Bumblebee's DP> Bears R' Us DP> Big Bad Johnny's DP> Caterpillar central DP> Coffee time!! DP> etc.- with the line break occuring in between each letter grouping. DP> Any help would be greatly appreciated. DP> -- DP> ------------------------------------------------------------ DP> http://www.phreshdesign.com Keep track of the first letter and if it changes echo a <br> $key = '' //loop through results while($result = mysql......){ $char = strtoupper(substr($row['name'],0,1)); if(empty($key){ $key = $char;//first result set key else{ if($key != $chat){ echo '<br>'; $key = $char; } } //rest of loop } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php