sorry that i have to bother you again, but the function won't work. i modified it like that:
function thread($id,$replyto=0)
{
$result = mysql_query("SELECT * FROM threads WHERE id=$id && parent_id=$replyto");
echo mysql_error();
if(mysql_num_rows($result))
{
while($myrow = mysql_fetch_array($result))
{
// this loop makes it indent
for($i=0;$i<=$replyto;$i++)
print " ";
// prints the subject
printf ("+ %s id:%s | replyto:%s<br>\n", $myrow["header"], $id, $replyto);
// this bit runs this function again
thread($id,($replyto+1));
}
}
}
and i run it with "thread(1)", but the only thing it does is to print out only the message with the id 1. any idea?
thanx, Phlow.