NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page [PHP]Users list

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
6 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 04-27-2011, 01:18 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
cipcip's Avatar
Join Date: Mar 2007
Location: Constanta, Romania
Posts: 502
cipcip is just really nicecipcip is just really nicecipcip is just really nicecipcip is just really nice
 



[PHP]Users list


A really simple php users list.

The code:

PHP Code:
<?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 />";
????: NamePros.com http://www.namepros.com/code/712745-php-users-list.html

$prev_row $letter;
}
?>
Will output this:

http://i53.tinypic.com/1zodlwz.jpg

Enjoy!
__________________
Social networking aggregator
cipcip is offline   Reply With Quote
Old 04-27-2011, 01:45 PM   #2 (permalink)
Tech Support
Join Date: Mar 2005
Posts: 4,944
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Instead of

PHP Code:
$letter strtoupper(substr($list['user'],0,1)); 
????: NamePros.com http://www.namepros.com/showthread.php?t=712745
You could also
PHP Code:
$letter strtoupper($list['user']{0}); 
Eric is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link Building Websites List - 1 to 8000 websites list with PR neejamb For Sale / Advertising Board 1 10-07-2010 01:13 PM
Legal/Attorney/Lawyer Link Exchange airnike764 Link Exchange Requests 2 10-07-2010 04:52 AM
What's This Russian Saying To Me? weblord The Break Room 4 07-08-2006 01:45 AM

 
All times are GMT -7. The time now is 07:40 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger