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 3975822
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:43:52+00:00 2026-05-20T04:43:52+00:00

OK lets start at the beginning, we are at a stage that we need

  • 0

OK lets start at the beginning, we are at a stage that we need to create documentation for our product. And as our product is web-based, I intend to create an on-line documentation + add a copy of this on each product.

The documentation I have planned will use PHP-HTML front and Database Back-end.

So here is what im trying to structure:

Table of Contents
    1 Getting Started
        1.1 Hello World
        1.2 Installing
            1.2.1 Windows
            1.2.2 Unix
            1.2.3 Mac
        1.3 Configuring
            1.3.1 Windows
            1.3.2 Unix
            1.3.3 Mac
    2 Hal
        2.1 Dave
        2.2 9000
        ....
        ....

So HERE is the table.

CREATE TABLE content(
    id VARCHAR(50) NOT NULL,
    parentId VARCHAR(50) DEFAULT NULL,
    title VARCHAR(255) NOT NULL,
    message TEXT NOT NULL,
    dateReg TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

    PRIMARY KEY(id)
    FOREIGN KEY (parentId) REFERENCES `content` (id) ON DELETE CASCADE ON UPDATE CASCADE
)

Please forgive the syntax, this is only a mockup

The inserts will be as follows

INSERT INTO content ('1', 'Getting Started', 'Hello', NULL);
INSERT INTO content ('1.1', 'Hello World', 'cout << \"Hello World\";', NULL);
.... and so on

The retrieval will have to done in php. The below is only making a “table of content like structure”

$top_query = "SELECT * FROM content WHERE parentId IS NULL";
while($top_res = mysql_fetch_array($top_query)){

    print $top_res['title'] . "\n";

    $child_query = mysql_query("SELECT * FROM content WHERE parentId={$top_res['id']}");
    while($child_res = mysql_fetch_array()){

        print $child_res['title'] . "\n";
    }
}

Now i know what you will say, it needs to be recursive, yes i know, and right now lack of sleep is so bad that i cant even spell recursive (It was auto spelt by google chrome). But recursion is not my issue, i can figure that out.

My Problem: I cant help it think this is gona send out alot of queries, and the Database is gona have a heart attack per user accessing this document.

The Question: Am i on the right track, or has any one have suggestions to make this work sufficiently and be less performance intensive.

Thanks in advance

  • 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-20T04:43:53+00:00Added an answer on May 20, 2026 at 4:43 am

    I think the best is to cache your table of contents in a .html file instead of calling a script which will always return the same content. You just have to recreate the cache every time the table of contents is changed.

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

Sidebar

Related Questions

Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user
Lets say I have several web sites on my web server, all as applications
Let's start with the following snippet: Foreach(Record item in RecordList){ .. item = UpdateRecord(item,
Let's say you want to start contributing to an open source project with thousands
Lets say I have a Dictionary object: Dictionary myDictionary<int, SomeObject> = new Dictionary<string, SomeObject>();
Lets say I have the following code: abstract class Animal case class Dog(name:String) extends
Lets assume my classes are loaded from a compressed .war file or loaded elsewhere,
Lets assume we have this xml: <?xml version=1.0 encoding=UTF-8?> <tns:RegistryResponse status=urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure xmlns:tns=urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0 xmlns:rim=urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0> <tns:RegistryErrorList
Lets say on MySQL database (if it matters).
Lets say I've got two interchangeable pieces of code and I want to figure

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.