|
|
|
|
|
|
|
![]() |
#1 |
Wheither you think you can or you think you can't, Your right.
|
PHP - Rotating links per Alpha
I have a place I need to rotate links by alpha, different each day. Like some links list do, each day the list starts with a different letter of the alphabet.
Seems I've seen people talk of using the day of the month to pick the letter. Course there are only 26 letters and months differ. Sure it's right on front of me, but I am sure not getting it right now. I will of course use this to pull from my MySQL db. Any ideas? Thanks in advance. ronnie |
![]() |
![]() |
![]() |
#2 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
if you know your starting letter and record it somewhere:
select if(sortletter<'$firstletter',ascii(sortletter)+100,ascii(sortletter)),title from links order by 1,title;
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#3 |
Wheither you think you can or you think you can't, Your right.
|
Letter will be different each day. And will use the code in a db select, so would do the same thing each day, unless I am missing something.
ronnie |
![]() |
![]() |
![]() |
|
|