For basic display, you may use:
SELECT * FROM `Table` WHERE `parent_of` = 0;
It will give you all the root nodes.
When user click on a node, he / she / it submits request to the server (Ajax maybe) to fetch child nodes for clicked one, like:
$node = abs((int)$_GET['node']);
then:
SELECT * FROM `Table` WHERE `parent_of` = {$node};