Jump to content

Getting weekly random instead of latest?


Recommended Posts

Can somebody help me change this line of code:

photos WHERE approved=1 AND cat IN (501,511,502,503,562,504,506,505,508,2,510) ORDER BY date DESC LIMIT 10", $link);

So that instead of grabbing the 10 latest items of content from my site, it instead grabs 10 random items from only the most recent week?


I am a real noob when it comes to php and I'm thinking this can be changed using the rand() command, but I have no idea how to make it so that it only chooses those random items from the past week.


Thanks for any help you can provide on this probably simple change.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

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

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.