JohnnyDoomo Posted December 30, 2014 Share Posted December 30, 2014 Simple for you, but I am very new to just messing around with mysql functions. I have 1 table that tracks both the item id and the amount of views the item has. The id column is called gId, and the views column is called gplays. All I am trying to do is get it to show a list of the latest 100 items, but sort them as most viewed. I've looked at online tutorials to googling the function, but can't find anything that works. Here's my current code: $results = $db->cachegetall(300, "SELECT gId id, gName name, gDescription descr, gThumb thumb, gplays plays FROM games ORDER BY gId DESC LIMIT 100"); that just shows the latest 100. When I try ORDER BY gId DESC, gplays DESC LIMIT 100"); I get nothing different. If I do ORDER BY gplays DESC LIMIT 100"); I get the 100 results, but they are from all items, and I want to only get it from the latest 100 items. Can someone help me? I really have no idea what these functions are doing, other than the very basic tutorials I've read on the order by function. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.