vividona Posted February 8, 2010 Share Posted February 8, 2010 I need to know how can I make mysql query calling sticky topics first then normal topics. $q = mysql_query("SELECT * FROM `articles` WHERE `artid`='".artid.'' ORDER BY `sticky` LIMITED 10"); Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/ Share on other sites More sharing options...
Solution jl5501 Posted February 8, 2010 Solution Share Posted February 8, 2010 if 'sticky' is an integer and has the value 1 for sticky and 0 for normal, then you order by sticky desc and you will get what you need Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/#findComment-1008723 Share on other sites More sharing options...
vividona Posted February 8, 2010 Author Share Posted February 8, 2010 if 'sticky' is an integer and has the value 1 for sticky and 0 for normal, then you order by sticky desc and you will get what you need thank you jl5501 everything its ok Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/#findComment-1008805 Share on other sites More sharing options...
hansford Posted November 4, 2015 Share Posted November 4, 2015 If everything is "ok" why not close the topic and mark it as "Answered". Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/#findComment-1525520 Share on other sites More sharing options...
ginerjm Posted November 4, 2015 Share Posted November 4, 2015 Hopefully you have corrected that query sample you posted and that you have converted from using the deprecated MySQL_* functions from your script. Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/#findComment-1525527 Share on other sites More sharing options...
requinix Posted November 4, 2015 Share Posted November 4, 2015 Almost six years, guys. Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/#findComment-1525531 Share on other sites More sharing options...
ginerjm Posted November 4, 2015 Share Posted November 4, 2015 Never even noticed..... Quote Link to comment https://forums.phpfreaks.com/topic/191321-sticky-topics/#findComment-1525533 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.