I am trying to setup a navigtion link section on my home page. what i have is a table called section in mysql and this is the way it is setup up.
+----+-----------+----------+
| ID | name | parentid |
+----+-----------+----------+
| 2 | News | 0 |
| 3 | Service | 0 |
| 4 | Terms | 3 |
| 5 | Recent | 2 |
| 6 | Policy | 4 |
| 7 | Downloads | 0 |
| 8 | Links | 0 |
| 9 | Tech | 8 |
+----+-----------+----------+
I have a start on the php with this
<?PHP
ERROR_REPORTING ('E_ALL ^ E_NOTICE');
require_once ('../includes/DbConnector.php');
$connector = new DbConnector();
$result = $connector->query('SELECT * FROM cmssection');
if(!$result) {
echo ('<p class="error">Error from query: ' .$connector->getSqlError(). '</p>');
} else {
echo ("<table border=\"0\" width=\"180\"> \n");
echo ("<tr> \n");
echo ("<td><h5>Main Links</h5></td></tr> \n");
while ($row = $connector->fetchArray($result)) {
echo ("\n <tr> \n");
echo ('<td width="100%" bgcolor="#E6E6E6"><a href="test.php?ID='.$row['ID'].'" class="menulink">'.$row['name']. '</a></td>');
echo ("\n </tr> \n");
}
echo ("</table> \n");
}
?>
but what i want to do is place each row under it's parent can anyone help