My navigation table looks like this. 
It based on a parent<->child scheme.
I’m using following code to generate breadcrumb.
function makeBreadcrumb($current, $lang, $db){
$q = $db->query("SELECT id, parent, $lang AS name FROM nav WHERE id = '$current'");
$row=$q->fetch_object();
echo "<li>";
echo '<a href="?id=' . $row->id . '">' . $row->name . '</a>';
echo "</li>\n\n";
if($row->parent) makeBreadcrumb($row->parent, $lang, $db);
}
But getting reversed breadcrumb: it shows child>parent instead of parent>child
.How to fix that?
The solution is very easy…you can simply put the recursive call before the
echostatment, like this:But I raccomend you not to do a query for each node in the tree. It could be very resource-expenshive.