WordPress.org

Ready to get started?Download WordPress

Forums

Generating Random Content from the Database (3 posts)

  1. mkgago
    Member
    Posted 9 years ago #

    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.

  2. Kafkaesqui

    Posted 9 years ago #

    I'd recommend digging through one or more randomizer plugins:

    http://codex.wordpress.org/Plugins/Randomness

    (Or perhaps there's one there that fit's the bill.)

  3. mkgago
    Member
    Posted 9 years ago #

    thanks, Kafkaesqui.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.