neoseeyou Posted April 27, 2015 Share Posted April 27, 2015 (edited) 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 April 27, 2015 by neoseeyou (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted April 27, 2015 Share Posted April 27, 2015 Try $sql .= ' AND published = 1 OR id_image = 777 ORDER... Link to comment Share on other sites More sharing options...
neoseeyou Posted April 27, 2015 Author Share Posted April 27, 2015 Thank you, unfortunatly this code $sql .= ' AND published = 1 OR id_slide = 7 ORDER BY RAND() LIMIT 5'; doesn't work, sometime the slider ID 7 is not present beetween the 5 sliders displayed Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now