|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Comparing Dates?? Methods of ordering posts?
I've created a forum... the only problem I've had so far is getting the posts to show up in order of the last post... An example of how my lost post is set up is 1:11:11 PM on 1/27/03 by PhreakShow64, now i was just ordering them by that but today i got the problem that 7 AM posts were being displayed before 4 PM posts, any ways you can think of to order it??
|
|
#2
|
|||
|
|||
|
Try this...
Have you tried ordering it by the post id?!
ORDER BY post_id... If this doesn't fix the problem, answer me and tell me if you're using date and time separated columns or if you're using a timestamp column? Are you using MySQL?
__________________
Regards, Ramiro Varandas Jr. |
|
#3
|
|||
|
|||
|
Oops sorry i didnt mean the posts i meant the threads! I already have the posts ordered by the post id but that wont work with Threads because they could be posted on long after they are made... The date and time are not separated its in one mysql field.. last_post and it contains date, time and poster
|
|
#4
|
|||
|
|||
|
You can use this:
SELECT * FROM table WHERE ... ORDER BY (timestamp_field <= NOW()); |
|
#5
|
|||
|
|||
|
Didn't help, it just spread things all over the place
|
|
#6
|
|||
|
|||
|
You could try giving your threads a "last activity" column which holds the timestamp of the last date when someone posted in it - then simply order by that column. Recently posted ones come first, others come last.
Last edited by Jeb. : January 27th, 2003 at 06:40 PM. |
|
#7
|
|||
|
|||
|
Yeah...
Yeah... I would take Jeb's advice... it seens to be the easiest and simple solution.
|
|
#8
|
|||
|
|||
|
Thanx
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Comparing Dates?? Methods of ordering posts? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|