Worked great.

Thanks!!


"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Thursday, November 20, 2003, 11:12:55 AM, you wrote:
> TR> Hi,
>
> TR> Keep track of the first letter and if it changes echo a <br>
>
> TR> $key = ''
>
> TR> //loop through results
>
> TR> while($result = mysql......){
> TR>   $char =  strtoupper(substr($row['name'],0,1));
> TR>   if(empty($key){
> TR>     $key = $char;//first result set key
> TR>   else{
> TR>     if($key != $chat){
> TR>       echo '<br>';
> TR>       $key = $char;
> TR>     }
> TR>   }
> TR>   //rest of loop
> TR> }
>
> TR> --
> TR> regards,
> TR> Tom
>
> Stupid keyboard :)
>
> $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 != $char){
>       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

Reply via email to