<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
&lt;?php
$dbcnx = @mysql_connect("localhost", "root", "pw");
mysql_select_db('phpbulletin');
//cats

$catagories = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM categories"));
for($tempVar = 1; $tempVar &lt;= $catagories["COUNT(*)"]; $tempVar++)
{
$authordetails = mysql_query("SELECT Name, id FROM categories WHERE id=$tempVar");

$author = mysql_fetch_array($authordetails);
$name = $author["Name"];
$id = $author["ID"];

echo("&lt;B&gt;$name&lt;/B&gt;&lt;HR&gt;");


$Catagories = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM Categories where ID=$tempVar"));
for($tempVar2 = 1; $tempVar2 &lt;= $Catagories["COUNT(*)"]; $tempVar2++)
{
$authordetails2 = mysql_query("SELECT Name, ID FROM Categories WHERE catid=$tempVar2 AND ID=$tempVar");

$author2 = mysql_fetch_array($authordetails2);
$name = $author2["Name"];
$id = $author2["ID"];

echo("&lt;A HREF=list.php3?catid=$id&gt;$name&lt;/A&gt;&lt;BR&gt;");
}
}
?&gt;
[/code]

Don't worry about the variable names, okay? I pasted it out of my other script...

It is supposed to display the categories with the forums under it - but it just doesn't work

Thanks...

------------------
Webmasters' Network
WebDevHQ.com - The Web Developer Headquarters
WebmasterChronicles.com - FREE online newsletter!