Jump to content

Categories & Sub-Categories


Kanundra

Recommended Posts

I have two tables, one called Categories and one called SubCategories. Each subcategory needs to be displayed under its parent category in a HTML table.

 

So I have this code, but I don't know how to list each Sub-Category under each Category in a HTML table.

 

<?php

 

require ('includes/initialize.php');

 

require 'classes/database.class.php';

 

 

$sql = "SELECT * FROM Categories, SubCategories WHERE Categories.ID = SubCategories.CatID";

 

$Result = $database->Query($sql);

 

$Data = $database->Fetch($Result);

 

?>

Link to comment
https://forums.phpfreaks.com/topic/228858-categories-sub-categories/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.