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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:22:44+00:00 2026-06-02T22:22:44+00:00

In my admin section, I want the user to be able to click a

  • 0

In my admin section, I want the user to be able to click a button and a HTML report to display all fields from all tables with the user id that is set in that session.
So $user_id = intval($_SESSION['user_id']);

Would the button be something like:

<?php
if (isset($_POST['doReport'])) {

$link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make connection.");

$query = ("SELECT user_id FROM users WHERE user_id = '$user_id');
}
// redirect to report page
            header('Location: report.php?id=' . $user_id);
?>
 <p align="center">
                <input name="doReport" type="submit" id="doThesisReport" value="View Report">

Also, what would be the best way to lay it out in the report page as I have 7 tables.
I am looking for a quick easy fix
Thank you!

  • 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-02T22:22:45+00:00Added an answer on June 2, 2026 at 10:22 pm

    The good way to achieve this would be :

    • Make a button witch redirects to a new page, say “report.php”.
    • Now create the following logic for redirect page:

      1. Fetch the USER-ID from session using the code you’ve used above.
      2. Make the database connection on this page.
      3. You forgot to use mysql_select_db(); to select the database.
      4. Write the query like :

        $query = ("SELECT user_id FROM users WHERE user_id = '$user_id'");
        // you left "
        
      5. Fire the query using $result=mysql_query($query); Note that the result from database is saved into $result.
      6. You can use tables to display data as per you liking but quick way would be to use print_r($result)
      7. Close the connection using mysql_close();

    Hopefully since the question is not clear, I’ve posted the basic logic.

    EDITED : forgot to put query in code block.

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

Sidebar

Related Questions

I have an ASP.NET 3.5 e-commerce site that has an admin section. I want
I've built a simple cms with an admin section. I want to create something
I want to have a /admin section in my application, and have routes within
Client wants to click a link and auto login to Wordpress backend admin section.
Is it possible to edit an entrie's status outside the admin section? I want
I'm making a form (html & php) which is part of an admin section
I have two dropdowns @using (Html.BeginForm()) { <fieldset> <legend></legend> <label>User details</label> <section> @Html.LabelFor(model =>
I'm currently working on an admin section for a website. The admin can use
I'm currently working on the admin section of a Wordpress plugin and I need
I ran into a problem loading the admin section of my django site with

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.