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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:15:17+00:00 2026-05-15T06:15:17+00:00

I have an input form connected to a database. After [the form is submitted],

  • 0

I have an input form connected to a database.
After [the form is submitted], I want to make a form to show all the data which has been input to the database. I want to show this data in table sortable by name or date.

Please help me.

  • 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-15T06:15:17+00:00Added an answer on May 15, 2026 at 6:15 am

    The high-level steps you want to take are:

    1. Print HTML table header
    2. Establish a connection to the database
    3. Issue a query, and capture the result (e.g. as an array)
    4. Loop through the array, printing each HTML table row
    5. Clean up database objects that may be holding onto memory or db connections
    6. Print HTML table close

    The following example is a slightly modified version of example #2 from this page on php.net. I suggest you spend a lot of time on that site – the manual is excellent, and almost every page has numerous working examples in the comments section.

    <table>
    <?php
    // Establish the database connection
    mysql_connect("localhost", "mysql_user", "mysql_password") or
        die("Could not connect: " . mysql_error());
    mysql_select_db("mydb");
    
    // Issue the query
    $result = mysql_query("SELECT id, name FROM mytable");
    
    // Capture the result in an array, and loop through the array
    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
        // Print each row as HTML: <tr><td>row 0</td><td>row 1</td>
        printf("<tr><td>%s</td><td>%s</td></tr>", $row[0], $row[1]);  
    }
    // Free the result set    
    mysql_free_result($result);
    ?>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple .net windows form which inserts user input into sql database.
I am designing a database app, and have a form which populates with data
I have this input form which goes like this: <input type=checkbox name=vehicle value=Bike />
I have a situation where i have to take input(form) from user. After continue
I am trying to make an input form have a background image, but as
I have a WPF form where I'm trying to make a simple input form.
I have code to retrieve data from a database into a form but it
I have a form that i want to submit comments to a database containing
I have an input form with two textareas allowing a user to type in
I have a complex input form within a PHP based web application. To structure

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.