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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:28:12+00:00 2026-06-04T15:28:12+00:00

I have an input box where users can enter tags when they ask a

  • 0

I have an input box where users can enter tags when they ask a question. They are separated by commas, like this:

test1, test2, test3, test4

My questions table structure is:

enter image description here

To show the tags of a question I just use explode(",", $qinfo['tags']) and then a foreach loop.

But, I don’t know how I can display tags from most popular to least popular on a separate “popular tags” page.

Thanks for any help!

  • 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-06-04T15:28:14+00:00Added an answer on June 4, 2026 at 3:28 pm

    You should create tags and questions_tags table.

    tags
    ----
    id
    name
    
    questions_tags
    -------------
    id
    question_id
    tag_id
    

    And get tags sorted by popularity:

    SELECT t.id, t.name, COUNT(qt.id) AS total
    FROM tags t
    LEFT JOIN questions_tags qt ON t.id=qt.tag_id
    GROUP BY t.id, t.name
    ORDER BY total DESC
    

    But I suggest you to keep the tags field in the questions table. Use it for caching. eg: if you’re displaying a single question, no need to query the tags and questions_tags table.

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

Sidebar

Related Questions

id like to have an input box that a user can enter a search
I have a textarea which users can enter some tags. I need to limit
I have an input box where the user can enter a string date, for
Have a text input box. Would like the user to enter a string in
I have an EditText box where the user can enter input. I need to
In this blog, http://www.bswebdev.com/2008/12/javascript-change-input-box-type-to-password/ I have found the following snippets for fixing change input
I have created a django application. Using this app users can be created or
I have created an edit text box where the user can input information. As
I have a string value from a user input box. I have to figure
I have an input box <input type=text name=search id=search /> <img src=icon.png alt= id=doSearch

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.