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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:51:33+00:00 2026-05-15T05:51:33+00:00

I am trying to build a website with mysql and php. This is the

  • 0

I am trying to build a website with mysql and php. This is the first site I have attempted so I want to write a little plan and get some feedback.

The site allows users to add some text in a text field as a “comment”. Once the comment has been entered into the site it is added to the database where it can be voted for by other users.

When a new comment has been added to the database it needs to create a new page, e.g. http://www.xxxxx.com/commentname or http://www.xxxxxx.com/?id=99981.

There will be a list of “Comments” in the database along with the number of votes for each comment.

The home page will have two functions.

1) Allow users to add a “comment”

2) Display two tables, each with 20 rows containing most “popular comments” and “recent comments”

Each comment will generate its one page where the comment will be displayed. Here users can read the comment and Vote for the comment if they wish.

Please help me out by explaining how to do the following.

-Generate a new page whenever a comment is added to the database

-Add a vote to the vote count in the comment database.

-Display the top 20 most popular comments as per number of votes.

  • 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-15T05:51:34+00:00Added an answer on May 15, 2026 at 5:51 am

    -Generate a new page whenever a comment is added to the database

    You only need a comment.php file with a MySQL query getting the given comment out of the database. I would recommend to use the comments primary key to get the comment. Using rewrites you can have a URL like this: http://www.xxxx.com/comment/1. If you need the redirect for a specific link structure ask again.

    -Add a vote to the vote count in the comment database.

    Just add a column to your table holding the votes. If you have logged in users and you want then to check their votes, create a new table for the votes and another table for the many to many realtion.

    -Display the top 20 most popular comments as per number of votes.

    This is simply done by sorting in the MySQL queries and selecting only 20 results:

    // For the recent 20 comments
    SELECT * FROM comments ORDER BY id DESC LIMIT 0,20
    // For the 20 most popular comments
    SELECT * FROM comments ORDER BY votes DESC LIMIT 0,20
    

    Any further questions?

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

Sidebar

Related Questions

Now I have my website built on PHP & Mysql. Consider this like a
I am trying to build a website and I want to have a map
I am trying to build a php/mysql website. But in the past, i didn't
I am trying to build openid login system for my website. To do this
Trying to build a website where the background of the site is a video
We are trying to build a website for our school project. The site will
I am trying to build a website with a background image that I want
I am trying to use Dreamweaver to build a Lyrics database website. I have
I'm trying to build a MySQL select statement to get all data out of
I'm trying to build a website with a uniform layout. These two pages have

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.