to html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
<!-- To jest miejsce na treść dokumentu -->
<?php
require_once('db_func.php');
require_once('post_func.php');
$anc = '0';
show_posts_tree($anc);
?>
i php
function show_posts_tree($anc){
if ($con = db_con()){
$q = "select * from thread where ancestor_id=$anc";
if($erra = $con->query($q)){
$c = $erra->num_rows;
for($i=0;$i<$c;$i++){
$r = $erra->fetch_assoc();
$link = "index.php?id=forum&s=". $r['thread_id'];
echo "<li><a href='$link' alt='$link'><b>".$r['title']. "</b></a>";
show_posts_tree($r['thread_id']);
}
$erra->free();
}
db_discon($con);
}
return $c;
}