Xyphon Posted June 5, 2010 Share Posted June 5, 2010 I'm making forums, how do I make it so when someone replies to a topic, it goes to the top of the page? I know it's a simple question, I want a simple answer. Link to comment https://forums.phpfreaks.com/topic/203965-make-it-so-when-someone-replies-to-topic-it-goes-to-top/ Share on other sites More sharing options...
mraza Posted June 5, 2010 Share Posted June 5, 2010 you can add one date column in your replies table, and sort them by date Link to comment https://forums.phpfreaks.com/topic/203965-make-it-so-when-someone-replies-to-topic-it-goes-to-top/#findComment-1068261 Share on other sites More sharing options...
Xyphon Posted June 5, 2010 Author Share Posted June 5, 2010 Quote you can add one date column in your replies table, and sort them by date Yeah, in my date column its set up as Y-m-d, but how do I order them by it? That's the confusing part. Link to comment https://forums.phpfreaks.com/topic/203965-make-it-so-when-someone-replies-to-topic-it-goes-to-top/#findComment-1068273 Share on other sites More sharing options...
GoneNowBye Posted June 5, 2010 Share Posted June 5, 2010 instead of y-m-d or whatever use an integer colomn and put the time() value into the number of seconds since the unix epoch - the first second of 1970. then just "order by `last_post` desc" Link to comment https://forums.phpfreaks.com/topic/203965-make-it-so-when-someone-replies-to-topic-it-goes-to-top/#findComment-1068286 Share on other sites More sharing options...
ignace Posted June 5, 2010 Share Posted June 5, 2010 Quote instead of y-m-d or whatever use an integer colomn and put the time() value into the number of seconds since the unix epoch - the first second of 1970. then just "order by `last_post` desc" And that doesn't work with a DATETIME column, because? Link to comment https://forums.phpfreaks.com/topic/203965-make-it-so-when-someone-replies-to-topic-it-goes-to-top/#findComment-1068306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.