HaZaRd420 Posted January 13, 2008 Share Posted January 13, 2008 I want to be able to submit and then have my text that I submited to the database, and actually put the old ones on the bottom and the new ones on top. Some how its the other way around... Is there a code for this in the php on the page or the mysql order? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/85780-displaying-the-help-please/ Share on other sites More sharing options...
phpQuestioner Posted January 13, 2008 Share Posted January 13, 2008 If you talking about displaying it in your page; you can create a field in your data table and set it as a timestamp and then order by that field. Quote Link to comment https://forums.phpfreaks.com/topic/85780-displaying-the-help-please/#findComment-437817 Share on other sites More sharing options...
HaZaRd420 Posted January 13, 2008 Author Share Posted January 13, 2008 Could I make the id time stamp? or will that mess with the id #'s Quote Link to comment https://forums.phpfreaks.com/topic/85780-displaying-the-help-please/#findComment-437858 Share on other sites More sharing options...
tinker Posted January 13, 2008 Share Posted January 13, 2008 if there all inserted in the order there posted then you could just use id instead, however it's usual practice to have a timestamp, which serves multiple purposes. http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html Quote Link to comment https://forums.phpfreaks.com/topic/85780-displaying-the-help-please/#findComment-437861 Share on other sites More sharing options...
HaZaRd420 Posted January 13, 2008 Author Share Posted January 13, 2008 Can you show what it looks like in code? pls thnx Quote Link to comment https://forums.phpfreaks.com/topic/85780-displaying-the-help-please/#findComment-437963 Share on other sites More sharing options...
trq Posted January 13, 2008 Share Posted January 13, 2008 You simply need to add a timestamp field to your table, then use a query something like... SELECT data FROM tbl ORDER by stamp DESC Quote Link to comment https://forums.phpfreaks.com/topic/85780-displaying-the-help-please/#findComment-437974 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.