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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:38:22+00:00 2026-06-17T18:38:22+00:00

I have 3 Tables one that contains the user’s info (including Log_Name), the logs

  • 0

I have 3 Tables one that contains the user’s info (including Log_Name), the logs (in which you can find Login) and the evaluation (if the user answered the ‘evaluation’ or not). All are connected by user_id field.

I want to output it in php in this manner:

enter image description here

Can you help me in solving this.

EDIT:
Someone suggested that I loop first Log_Name and inside that loop, I’ll loop the Login then display them in a table. But I have no idea how to do that.

  • 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-17T18:38:23+00:00Added an answer on June 17, 2026 at 6:38 pm

    Take a look at GROUP_CONCAT

    <?php
        session_start();
        require_once "common.php";
    
        $sql = "SELECT *,GROUP_CONCAT(log.date) as login_date FROM user INNER JOIN log ON log.user_id = user.id INNER JOIN evalution ON evalution.user_id = user.id GROUP BY user.id";
        $result = mysql_query($sql) or die(mysql_error());
    
    ?>
    <table width="40%" border=1>
        <tr>
            <td>Log_Name</td>
            <td>Login</td>
            <td>Evalution</td>
        </tr>
        <?php
            while($row = mysql_fetch_assoc($result))
            {
        ?>
        <tr>
            <td><?php echo $row['name'];?></td>
            <td><?php echo str_replace(",","<br/>",$row['login_date']); ?></td>
            <td><?php echo $row['evalution']; ?></td>
        </tr>
        <?php
            }
        ?>
    </table>

    GROUP_CONCAT(log.date) will return comma separated date listing then you can display it as per your need.

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

Sidebar

Related Questions

I have one user table. and second language table which contains language that user
I have two tables: Accounts , which contains the information of accounts that a
I have 2 tables: user and licenseduser. The first one contains all the users
I have two tables: one which contains items on a checklist (checklist_id, content), and
I have two tables, one that contains volunteers, and one that contains venues. Volunteers
Here is my situation: I have one table that contains a list of drugs
I have a TABLE elements with one COLUMN number, type SMALLINT that contains numbers
I have two tables, one that has 450 rows, the other is a Sort
I have two tables, one that has a foreign key from the other. I
I want to delete multiple records at once. I have two tables, one that

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.