Using the following insert :
Code:
INSERT INTO secrets(`Date`,Comment_For,Content)
VALUES
(NOW(),NULL,'Some content'),(NOW(),NULL,'More Content'),
(NOW(),NULL,'Some content'),(NOW(),NULL,'More Content'),
(NOW(),3,'Some content'),(NOW(),3,'More Content'),
(NOW(),2,'Some content'),(NOW(),1,'More Content');
You can do the following to get each thread + the number of sub threads it contains:
Code:
SELECT *,(SELECT COUNT(*) FROM secrets WHERE s1.ID=Comment_For)as num_threads FROM secrets s1;
The answer I have given above is assuming that there is only one level of threading. i.e. master -> thread and not master -> thread -> thread. So you can't have a thread of a thread of a thread.