Generating Random Content from the Database
On the sidebar of my site, I list some CDs in a list called “What I’m Listening To.”
Each listing is a little snippet of code that links to Amazon.com and downloads a picture of the CD cover from their server. Right now, I have four or five albums listed. But I’d like to make that list randomized and dynamic.
What I’m thinking is that I will set up a table in the database, and add the Amazon links for each CD. I’d then like to randomly call five or so CDs from that list.
I’m comfortable with MySQL, but my php is a little spotty; can anyone suggest a good way to go about writing the randomizing code?
Thanks in advance for your help.
- The topic ‘Generating Random Content from the Database’ is closed to new replies.