Jump to content

[SOLVED] mysql db order by forum threads


ted_chou12

Recommended Posts

I asked similar question yesterday, however, this case is more complicated:

I store forum threads in mysql db, all of which are in one table, there are two types of thread, so I made a column called threadattribute, one kind is starter threads, starting each topic, and other threads just continue the same topic started by starter threads. Therefore, in other words, the total number of continue threads is the replies. One starter thread and several continue threads are grouped together using threadid, therefore, they can be easily recognized as one topic, so the table looks something like this:

threadid threadattribute

1stater

1continue

1continue

2stater

1continue

2continue

In logic, there will always be one starter thread for each threadid, however, the continue threads can be infinite.

What I wish to do, is to order these threadids according to the frequency of the continue threads, in other words, the no. of replies.

However, this is really confusing even to myself, can anyone help me out please?

Thanks

Ted

Link to comment
https://forums.phpfreaks.com/topic/38172-solved-mysql-db-order-by-forum-threads/
Share on other sites

sorry, i dont quite understand you, but i do have another column purely called id, i didnt put it up because i dont think it helps in organizing the query, and i need to organize by the number of rows anyways, so I didnt bother about that.

Ted

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.