Jump to content

Display images randomly except one ID


Recommended Posts

Hello All

 

I want to display only 5 images randomly but i also want to always keep a specific image into these 5 images displayed.

 

I have this code: $sql .= ' AND published = 1 ORDER BY RAND() LIMIT 5';

 

But i miss the code to include the specific image ID into the 5 displayed

 

Someone can help me with this ?

 

Thank you

 

Cheers

Edited by neoseeyou (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...