phpSensei Posted October 13, 2007 Share Posted October 13, 2007 What if i had a table with a bunch of data (e.g. Items, Price, Views)... I want to order the coloumns by the most viewed with the LIMIT of 30. Now, I want to give out awards for the items that belong in the 30 most viewed list. I have a "?id=1" from the url and i want a query to check if that id belongs in the 30 most viewed items... how? Link to comment https://forums.phpfreaks.com/topic/73038-solved-get-record-by-order/ Share on other sites More sharing options...
trq Posted October 13, 2007 Share Posted October 13, 2007 SELECT items FROM tbl WHERE id = 1 && id IN(SELECT id FROM tbl ORDER BY view DESC LIMIT 30); If this fails to return a result then id number 1 is NOT in the top 30. Link to comment https://forums.phpfreaks.com/topic/73038-solved-get-record-by-order/#findComment-368385 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.