I'd like to create a A-Z index so that when a user clicks A, it lists all the rows with the title that starts with A. Can anyone point me towards a tutorial that will help me achieve this?
Thanks
2 replies to this topic
#1
Posted 07 June 2011 - 06:02 AM
|
|
|
#2
Posted 07 June 2011 - 07:17 AM
You should be able to provide alphabetical order with "ORDER BY title", and display only titles with A with "WHERE title LIKE 'a%' ORDER BY title;"
MySQL :: MySQL 5.0 Reference Manual :: 3.3.4.4 Sorting Rows
MySQL :: MySQL 5.0 Reference Manual :: 11.5.1 String Comparison Functions
MySQL :: MySQL 5.0 Reference Manual :: 3.3.4.4 Sorting Rows
MySQL :: MySQL 5.0 Reference Manual :: 11.5.1 String Comparison Functions
Edited by Alexander, 07 June 2011 - 07:54 AM.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 07 June 2011 - 07:54 AM
Alexander! isn't it "LIKE 'a%'?
As he wants to display those which starts with A. As quoted below,
As he wants to display those which starts with A. As quoted below,
jwg2s said:
I'd like to create a A-Z index so that when a user clicks A, it lists all the rows with the title that starts with A.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









