<BLOCKQUOTE><font size="1" face="Verdana, Arial">code /font><HR><pre>
<?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 <= $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("<B>$name</B><HR>");
$Catagories = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM Categories where ID=$tempVar"));
for($tempVar2 = 1; $tempVar2 <= $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("<A HREF=list.php3?catid=$id>$name</A><BR>");
}
}
?>
[/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!
SitePoint Wizard
<?php
$dbcnx = @mysql_connect("localhost", "root", "pw");
mysql_select_db('phpbulletin');
//cats
$res = mysql_query("SELECT * FROM categories");
while ( $author = mysql_fetch_array ( $res ) ) {
$name = $author["Name"];
$id = $author["ID"];
echo("<B>$name</B><HR>");
echo("<A HREF=list.php3?catid=$id>$name</A><BR>");
}
?>
------------------
Karl Austin
KDA Web Services
"Everyone has a photographic memory. Some just don't have film."
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks