Jump to content

kwnocree

Members
  • Content Count

    4
  • Donations

    $0.00 
  • Joined

  • Last visited

Posts posted by kwnocree


  1. Hi i created a php code but it is maybe wrong....

    The Subcategory name it is displaying 2 times..

    Php Code:

    $catssql = "SELECT * FROM cats1";
    $result2 = mysql_query($catssql);
    
    echo '<table width="800" class="productstable" align="center">';
    while($cats1row = mysql_fetch_assoc($result2))
    {
    echo '<tr><td><b>'. $cats1row['cat_nm'].'</b></td></tr>';
    $ctid = $cats1row['id'];
    $catsoncat = "SELECT * FROM categories,cats1 WHERE categories.catid = $ctid";
    $result3 = mysql_query($catsoncat);
    while($catsoncatrow = mysql_fetch_assoc($result3))
    {
    echo '<tr><td>'.$catsoncatrow['cat_name'].'</td></tr>';
    }
    }
    echo '</table>';

    If anyone knows how to fix it help please :)

×