[PHP]Users list

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

cipcip

Top Member
Impact
1,675
A really simple php users list.

The code:

PHP:
<?php
$sql = "SELECT * FROM users ORDER BY user";
$res = mysql_query($sql);

if (mysql_num_rows($res)){
while ($list = mysql_fetch_array($res)) {

$letter = strtoupper(substr($list['user'],0,1));

if ($letter != $prev_row) {
echo "<br /><b><u>$letter</u></b><br />";
} 

echo "<a href='#'>{$list['user']}</a> <br />";

$prev_row = $letter;
}
?>

Will output this:

1zodlwz.jpg


Enjoy!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Instead of

PHP:
$letter = strtoupper(substr($list['user'],0,1));

You could also
PHP:
$letter = strtoupper($list['user']{0});
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back