SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <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!

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    &lt;?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("&lt;B&gt;$name&lt;/B&gt;&lt;HR&gt;");
    echo("&lt;A HREF=list.php3?catid=$id&gt;$name&lt;/A&gt;&lt;BR&gt;");

    }
    ?&gt;

    ------------------
    Karl Austin
    KDA Web Services
    "Everyone has a photographic memory. Some just don't have film."

  3. #3
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •