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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:16:43+00:00 2026-05-16T11:16:43+00:00

i have table question (mysql with php) which contains question,category(multiple) and subcat(multiple) its belong.

  • 0

i have table question(mysql with php) which contains question,category(multiple) and subcat(multiple) its belong. for simplification while saving each question i saved the category in comma separated as below

qid    question      catid    subcat
2     question1        2,3,4   5,7

like this i have 1000 of question right now in DB

while coming with faceted search i want to filter out for each category and its corresponding subcat like tree format below

 cat1(5)
   subcat1(3)
   .........
 cat2(24)
 ..........

For this i just implemented in_array while searching for particular cat for each question in for each loop for that question table.The page getting slow now . along with text search also.

is it really good idea or suggest me some right way .

whether i wanna seperate table for category ?

Thanxs,
Gobi

  • 1 1 Answer
  • 1 View
  • 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-16T11:16:44+00:00Added an answer on May 16, 2026 at 11:16 am

    Yes the right way to do this is to have separate tables for both category and sub-category as:

    Table Category
    --------------
    qid   cat-id
    
    
    Table Sub_category
    ------------------
    qid   sub_cat_id
    

    This way your question table reduces to:

    Table Question
    ---------------
    id    Question
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a short access/mySQL question. I have a mapping table on the format
I have a table which is currently displayed like this: Question OptionType What is
I have a PHP MySQL application which has a modular design. There are about
I have a PHP web application which uses a MySQL database for object tagging,
Hey guys, I'm just starting out with MySQL and PHP and have a question.
I have a mysql question. I have an application which I am migrating to
I have a small PHP Mysql function which generates all the columns within a
I have two tables in MySQL, (and using PHP) which look similar to below:
I am in the process of building a PHP/MySql database application which could have
I have a table that get its rows from a MYSQL database <table id=table1>

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.