ok... here is my problem...
i am working with mySql 3.23 and php 4.xx on this page http://www.nevergetoveryou.net/ and have a problem with the forum.
i implemented a whole flat mode for the basically threaded forum without problems.
each forum has its own table - lets call it table "forumtable" - and has the following fields which are of concern for this issue:
id => unique id for each posting
parent_id => for threaded mode: id of the message the user answered to (if it is the first msg. in a thread it is '0')
thread_id => holds the id of the thread the message is part of
date => timestamp of posting
what i would like to change now is the following:
the threads always stay in the order they were posted in
SELECT * FROM forumtable WHERE parent_id = '0' ORDER BY postdate DESC
this way the output result consists of all the messages which are the first in a thread (i.e. those which started a thread). then you just have to recurse the subitems and voila.
the thing i want to change now is, that whenever a new message in a thread is posted, it gets "bumped" to the top, resulting in a displayed forumview, which is sorted by the most recently posted in threads.
i just cannot get my queries and php to produce the right result for me.
my idea:
sort the table by thread_id, find for each thread_id the message with the highest value of date - then sort the thread_id's according to that result. finally get the rows of the table with parent_id = '0' this time ordered by the value of the thread_id's we just calculated.
i hope this is understandable - anyways - i could not make it work and would be very happy about some help. it should just be a few lines of code, but i seem to be retarded to get my mySql skills together for that.
thanks a lot - sid stargraphX