Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:50:14+00:00 2026-05-27T05:50:14+00:00

I have the following tables category and category_description in php mysql. my question is

  • 0

I have the following tables category and category_description in php mysql. my question is how with the information below do i go about creating an unlimited amount of subcategories in a ul li structure. I have looked at various examples on here but no no avail many thanks for your time in reading this question. i look forward to your response

Column         Type         Null    Default
category_id    int(11)      No       
image          varchar(255) Yes     NULL     
parent_id      int(11)      No      0    
top            tinyint(1)   No       
column         int(3)       No       
sort_order     int(3)       No      0    
status         tinyint(1)   No       
date_added     datetime     No      0000-00-00 00:00:00      
date_modified  datetime     No      0000-00-00 00:00:00      

And the descriptions are stored in this table

Column            Type          Null
category_id       int(11)       No       
language_id       int(11)       No       
name              varchar(255)  No       
description       text          No       
meta_description  varchar(255)  No       
meta_keyword      varchar(255)  No       
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:50:15+00:00Added an answer on May 27, 2026 at 5:50 am

    opencart has the

    $this->model_catalog_category->getCategory()

    method, and you pass the category id as a parameter, such as

    $category = this->model_catalog_category->getCategory(5);

    That also handles the appropriate description join too so you don’t need to access them directly. As @Till Helge Helwig has already pointed out, you need to use a recursive function if you want to build a tree of these with all the subcategories. A good place to see an example of this is in the actual category module code. Scroll to the bottom of the file catalog/controller/module/category.php and you will see a recursive function that builds the html for it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two tables that record expenditure and provide expenditure category information:
I have the following tables category, Restaurant, and menu. A restaurant can have more
I have the following tables: tags id tag_name examples id category heading examples_tags id
I have the following tables used for sending messages about products to vendors from
I have the following tables: TABLE: category catid catfatherid catname 1 0 United States
I have the following mysql tables: CREATE TABLE `video` ( `video_id` int(11) unsigned NOT
I have the following tables: Category table which has an ID column, a description
I have a MySQL table (table1) with following fields... id, title, description, detail, category,
I have the following tables: Products Categories Subcategories Brands with the following fields: Products:
I have the following hierarchical table: Table Category: CategoryId, ParentCategoryId, CategoryName 1, null, SomeRoot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.