Page 1 of 1

paging in alphabetically order

Posted: Sun Nov 28, 2004 10:08 pm
by firestar_lene
how to do paging by alphabetically, where by data is from database?

Posted: Sun Nov 28, 2004 10:16 pm
by John Cartwright

Code: Select all

SELECT * FROM `users` ORDER BY `username` DESC
that should do the trick

paging

Posted: Sun Nov 28, 2004 10:21 pm
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

Posted: Mon Nov 29, 2004 1:58 am
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?

Posted: Mon Nov 29, 2004 4:12 am
by timvw

Code: Select all

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