Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   PHP - Rotating links per Alpha (http://www.greenguysboard.com/board/showthread.php?t=19755)

ronnie 2005-05-17 07:17 PM

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

cd34 2005-05-17 07:28 PM

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;

ronnie 2005-05-18 04:54 PM

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


All times are GMT -4. The time now is 02:06 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc