$threadquery=mysql_query("SELECT * from threads where topic_id='$id'");
while($getthreadrows=mysql_fetch_row($threadquery))
{
echo "<div class=singlepost>".$getthreadrows[2]."</div>";
}
You can see Its fetching each comment into a div. But I need to do one additional thing too. Each comment may have some reply comment. How to get em like simple thread style as we see in wordpress comments.
Here is trying to give a visual example how output should be,
XYZ says: hsdahfkasydf astdfsa dftasdf astdfasdf
TYU replied: why you writing wirdo?
IOP replied: wtf!
VBN says: I love daniweb.
DFG replied: me too.
I guess I need two query, one for mother comment and one for child comment(or reply whatever you say) and 2nd query need to be looped with for(....as...) ? Anyother ideas?