Nieuw lid |
|
ik heb geen idee wat ik moet veranderen bij "verander dit!" in het scriptje hieronder.
<?php
function niveau($n, &$output, $niv=0){
$result[$n] = mysql_query("SELECT * FROM link_system WHERE parent='".$n."' ORDER BY volgorde");
while($row[$n] = mysql_fetch_object($result[$n])){
$output .= str_repeat(" ", 7*$niv);
$output .= "<a href='".$row[$n]->url."' title='".$row[$n]->tooltip."'>".$row[$n]->text."</
a><br>";
niveau($row[$n]->id, &$output, $niv+1);
}
}
mysql_connect() or die("Couldn't connect to database");
//verander dit!
mysql_select_db("test") or die(mysql_error());
$output = "";
niveau(0, &$output, 0);
print $output;
?>
<?php function niveau($n, &$output, $niv=0){ $result[$n] = mysql_query("SELECT * FROM link_system WHERE parent='".$n."' ORDER BY volgorde"); $output .= "<a href='".$row[$n]->url."' title='".$row[$n]->tooltip."'>".$row[$n]->text."</ a><br>"; niveau($row[$n]->id, &$output, $niv+1); } } //verander dit! $output = ""; niveau(0, &$output, 0); ?>
|