I’ve always liked to collect quotes. Who doesn’t? Until now, though, I’ve never had a centralized location to store said quotes. Sure, they’ve traveled over the years from scraps of paper to my PDA to Yahoo! Notepad, but now, at long last, there’s a section of my Web site dedicated to housing my favorite quotes:
You may also notice the new “Random Quote” sidebar below my right-hand navigation. That’s also something I’ve been wanting to do for a long time and have finally gotten around to doing. Surprisingly, it was much easier than I ever imagined:
select * from quotes order by RAND()
Yup, that’s it. Well, that’s the SQL part of it anyway, which is, of course, wrapped into a PHP include file and refers to a new quotes table in my content database that stores all the text. But you get the idea.
Each click on a different area of my site or a reload of the browser will display a randomly-selected quote. The full set of quotes can always be seen in the quotes section, which randomly displays the order. The idea being: The bigger the list grows, the less precedence those quotes at the bottom would otherwise get; but with the random display, there’s fun for the whole family with every refresh..