need help, loops and ifs
Posted: Fri Aug 11, 2006 8:44 am
Hi hows it going.
I am looking to create my own forum page.
Each thread has an id, and each reply is a thread, only the difference is they have a "parent_id".
i want the code to check if the thread has any replies eg select * where parent_id = thread_id
this is all working fine. however, i want to have this recurring so that the code keep checking for EVERY reply, to see if this thread_id has any replies, so that the structure is like an endless loop, giving case or switches i think.
so a forum would look like this:
dave - 13/5/67
___reply - dave2 - 13/5/67
___reply - dave3 - 13/5/67
___reply - dave5 - 13/5/67
_______another reply - dave8 - 13/5/06
_______another reply - dave8 - 13/5/06
_____________and another reply - dave2 - 13/12/06
_______another reply - dave8 - 13/5/06
_______another reply - dave13 - 13/5/06
_____________and another reply - dave2 - 13/12/06
Can someone tell me where to start? i have looked into functions and stuff but cant seem to find they technically correct way of doing this.
I am looking to create my own forum page.
Each thread has an id, and each reply is a thread, only the difference is they have a "parent_id".
i want the code to check if the thread has any replies eg select * where parent_id = thread_id
this is all working fine. however, i want to have this recurring so that the code keep checking for EVERY reply, to see if this thread_id has any replies, so that the structure is like an endless loop, giving case or switches i think.
so a forum would look like this:
dave - 13/5/67
___reply - dave2 - 13/5/67
___reply - dave3 - 13/5/67
___reply - dave5 - 13/5/67
_______another reply - dave8 - 13/5/06
_______another reply - dave8 - 13/5/06
_____________and another reply - dave2 - 13/12/06
_______another reply - dave8 - 13/5/06
_______another reply - dave13 - 13/5/06
_____________and another reply - dave2 - 13/12/06
Can someone tell me where to start? i have looked into functions and stuff but cant seem to find they technically correct way of doing this.