Forum Moderators: coopster
nav (parent_id is a child of id)
id ¦ parent_id ¦ name
1 ¦ 0 ¦ nav
5 ¦ 1 ¦ sub
text
id ¦ text
5 ¦ temp
resulting xml should look like this:
<xml>
<nav id="1" name="nav">
<subnav id="5" name="sub" >temp</subnav>
</nav>
</xml>
I think you get the idea, so I'm I heading the right way? does the table structure make sense?
Here is what I have sofar:
mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");
$query = "SELECT * FROM nav";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)) {
$xml .= "<item ";
$xml .= "id='".$row[0]."' ";
$xml .= "name='".$row[2]."' ";
$xml .= "/>\n";
}
Thanks for the help!
It is all pre-written and maintained.
[json.org...]