this is my MySQL table:
Code: Select all
forum_id forum_parent forum_order forum_name forum_desc
1 0 0 cat1 cat1 descrption
2 0 1 cat2 cat2 Description
3 1 0 forum1 forum1 descrption
4 1 1 forum2 forum2 descrption
5 2 0 forum3 forum3 descrption
6 2 1 forum4 forum4 descrptionwell, if i don't do that then i'm accessing it like an array. so for instance
forum_id -> 0
forum_parent -> 1
forum_order -> 2
forum_name -> 3
forum_desc -> 4
this is important because this is how i'm referancing all of this now.
this is the code that i have so far:
Code: Select all
$index = $this->forumParent[2];
$queryStatement = "SELECT * FROM " . $this->pref . "forums";
$result = $this->sql->Execute($queryStatement);
$id = $this->forumRows[$index][0];
while(!$result->EOF)
{
if ($result->fields[1] == 0) // if it's the parent category then...
{
$id = $result->fields[0];
echo $id . '- <B>'.$result->fields['forum_name'].'</b><BR>';
while ($result->fields[1] == $id && 1)
{
echo $result->fields[3]. '<BR>';
}
}
$result->MoveNext();
}the output that i'm trying to get is this:
instead this is what i get with that code:
cat1
- cat1 descrption
--------------------
forum1 - [forum1 descrption]
forum2 - [forum2 descrption]
cat2
- cat2 Description
--------------------
forum3 - [forum3 descrption]
forum4 - [forum4 descrption]
cat1
cat2
well, i'm just about at wits end with this and i really need the help before i put my fist thru the computer monitor. i would really appreciate it