Kristoff1875 Posted May 27, 2013 Share Posted May 27, 2013 Currently lay in bed and it just popped in to my head (sad I know!) I'm not sure how I'd go about having featured items... If you've got a pagination showing 10 items per page, would it be possible to call everything from the "Male" (for example) column and then have the top 3 rows on each page random entries where they have the required value in the Featured column? Link to comment https://forums.phpfreaks.com/topic/278415-featuring-a-row-above-rand/ Share on other sites More sharing options...
requinix Posted May 27, 2013 Share Posted May 27, 2013 Sure: do 3 items with this random stuff and then only 7 items per page of the normal paginated stuff. Link to comment https://forums.phpfreaks.com/topic/278415-featuring-a-row-above-rand/#findComment-1432458 Share on other sites More sharing options...
Kristoff1875 Posted May 27, 2013 Author Share Posted May 27, 2013 So make 2 different calls to the database? I thought there may be a more efficient way of doing it all in 1 call? Link to comment https://forums.phpfreaks.com/topic/278415-featuring-a-row-above-rand/#findComment-1432514 Share on other sites More sharing options...
requinix Posted May 28, 2013 Share Posted May 28, 2013 Could use a UNION but it's still essentially two queries. Link to comment https://forums.phpfreaks.com/topic/278415-featuring-a-row-above-rand/#findComment-1432638 Share on other sites More sharing options...
Kristoff1875 Posted May 28, 2013 Author Share Posted May 28, 2013 Ok cheers, have done it, works well, I think! Thanks. Link to comment https://forums.phpfreaks.com/topic/278415-featuring-a-row-above-rand/#findComment-1432811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.