ted_chou12 Posted January 27, 2007 Share Posted January 27, 2007 when ordering the rows in a table (mysql) how do stickies work? do you have to setup a new column for it? if so, how would you put it into the mysql order by query?ThanksTed Link to comment https://forums.phpfreaks.com/topic/35948-how-do-stickies-work/ Share on other sites More sharing options...
Hypnos Posted January 27, 2007 Share Posted January 27, 2007 There might be a way to do it in MySQL directly, but I would just make a column, then add it to your ORDER BY.Numeric column with 1 on the "sticky". Everything else will be 0. Link to comment https://forums.phpfreaks.com/topic/35948-how-do-stickies-work/#findComment-170502 Share on other sites More sharing options...
Orio Posted January 27, 2007 Share Posted January 27, 2007 Create a is_sticky column, that will contain true/false (1/0).Then in your display query, change the order by part to something like this:[code]SELECT * ... ORDER BY is_sticky, date[/code]Orio. Link to comment https://forums.phpfreaks.com/topic/35948-how-do-stickies-work/#findComment-170503 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.