paging in alphabetically order

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
firestar_lene
Forum Newbie
Posts: 10
Joined: Mon Mar 29, 2004 2:04 am

paging in alphabetically order

Post by firestar_lene »

how to do paging by alphabetically, where by data is from database?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

SELECT * FROM `users` ORDER BY `username` DESC
that should do the trick
firestar_lene
Forum Newbie
Posts: 10
Joined: Mon Mar 29, 2004 2:04 am

paging

Post by firestar_lene »

i want to do paging like page 1,page 2,page 3 but in alphabet..not arrange the data in alphabet order

if the name of the company is under A,

it will be in A category

A| B|C|D
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

Post by myleow »

You can do it such that A category retrieve all A stuff from DB.

or are you looking for a way to retrieve all data from DB and then PHP automatically split the category?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

SELECT * FROM foo GROUP BY SUBSTRING(column, 1, 1)
Post Reply