mysterbx Posted March 26, 2008 Share Posted March 26, 2008 Hey, Is it possible to set a limit for the mysql_query, to show latest 70 downloads (limit 0,70) and order them by rand (order them randomly)? Quote Link to comment https://forums.phpfreaks.com/topic/98009-latest-70-downloads-order-by-rand/ Share on other sites More sharing options...
BlueSkyIS Posted March 26, 2008 Share Posted March 26, 2008 yes. your question was almost the query. Quote Link to comment https://forums.phpfreaks.com/topic/98009-latest-70-downloads-order-by-rand/#findComment-501473 Share on other sites More sharing options...
mysterbx Posted March 26, 2008 Author Share Posted March 26, 2008 $result = mysql_query("select * from downloadz order by id DESC AND RAND() limit 0,20"); doesnt work... Quote Link to comment https://forums.phpfreaks.com/topic/98009-latest-70-downloads-order-by-rand/#findComment-501477 Share on other sites More sharing options...
mysterbx Posted March 27, 2008 Author Share Posted March 27, 2008 someone! Quote Link to comment https://forums.phpfreaks.com/topic/98009-latest-70-downloads-order-by-rand/#findComment-502052 Share on other sites More sharing options...
sasa Posted March 27, 2008 Share Posted March 27, 2008 SELECT * FROM (select * from downloadz order by id DESC limit 70) AS xxx ORDER BY RAND() Quote Link to comment https://forums.phpfreaks.com/topic/98009-latest-70-downloads-order-by-rand/#findComment-502118 Share on other sites More sharing options...
mysterbx Posted March 29, 2008 Author Share Posted March 29, 2008 yeap, that works great, thanks... Quote Link to comment https://forums.phpfreaks.com/topic/98009-latest-70-downloads-order-by-rand/#findComment-503863 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.