<?xml version="1.0" encoding="ISO-8859-1"?>
<slide>
	<title>Trees</title>

	<table columns="3" class="dbtable" title="Tree">
		<cell class="header-key">ID</cell><cell class="header">Parent ID</cell><cell class="header">Name</cell>
		<cell>3</cell><cell>1</cell><cell>Countries</cell>
		<cell>4</cell><cell>3</cell><cell>Belgium</cell>
		<cell>5</cell><cell>3</cell><cell>Netherlands</cell>
		<cell>6</cell><cell>3</cell><cell>Germany</cell>
		<cell>7</cell><cell>5</cell><cell>Business</cell>
		<cell>8</cell><cell>5</cell><cell>Economy</cell>
	</table>
<break/>
	<blurb>Retrieving the full path to the root node goes with something like:</blurb>
<break/>
	<example><![CDATA[<?php
function collectPath( $id ) {
	global $dir;
	
	$res = mysql_query( "SELECT parent, name FROM dir WHERE id=$id" );
	if ( mysql_num_rows( $res ) > 0 ) {
		$dir[] = ( $row = mysql_fetch_row( $res ) );
		collectPath( $row['parent'] );
	}
}
$dir = array();
collectPath(7);]]></example>
</slide>
