Jump to content

Need to get random rows from child categories


sjaguar13

Recommended Posts

I have a links system that has categories. Each category either has links or more categories. I need to randomly get links to display in the main content area, if the category only contains more categories. The problem is I only want random links from the categories below the current category.

 

If I have:

-News

--USA

---New York

---California

--Canada

-Music

--Rock

---AC/DC

----Back In Black

 

For news, I could have any link in New York, California, or Canada. USA wouldn't have any links as all those would have to either be in New York or California. Another issue is the depth isn't always known. For news, 1 and 2 levels down contain links. For music, the 3rd level contains the links. Is there a way to get random links from only the categories below?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.