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

  • Home
  • SEARCH
  • 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 8124739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:33:44+00:00 2026-06-06T06:33:44+00:00

I have three tables: Employee(EmployeeID,Fname,Lname…) ProjectHeader(ProjectID,LeadID,Status….) ProjectDetails(ProjectDetailsID,ProjectID….) Here’s my current code: $get_projects = SELECT

  • 0

I have three tables:

Employee(EmployeeID,Fname,Lname…)
ProjectHeader(ProjectID,LeadID,Status….)
ProjectDetails(ProjectDetailsID,ProjectID….)

Here’s my current code:

$get_projects = "SELECT DISTINCT projectheader.ProjectID, projectheader.ProjectName ,projectheader.Lead, projectheader.StartDate, projectheader.EndDate, projectheader.Status, projectheader.Remarks, CONCAT (employee.Firstname, ' ' ,employee.Lastname) AS EmployeeName
FROM employee, projectheader, projectdetails
WHERE projectheader.ProjectID = projectdetails.ProjectID
AND projectheader.Lead = employee.EmployeeID";

$result = mysql_query($get_projects);

$project_id = "";
$project_name = "";
$project_lead = "";
$project_start = "";
$project_end = "";
$project_status = "";
$project_remarks = "";
$table = "";
$table .= "<table border='1'> <th>ProjectID</th>" 
."<th>Project name</th>" 
."<th>Lead</th>" 
."<th>Start</th>" 
."<th>End</th>" 
."<th>Status</th>" 
."<th>Remark</th>";
while($row = mysql_fetch_array($result))
{
    $project_id = $row['ProjectID'];
    $project_name =  $row['ProjectName'];
    $project_lead = $row['EmployeeName'];
    $project_start = $row['StartDate'];
    $project_end = $row['EndDate'];
    $project_status = $row['Status'];
    $project_remarks = $row['Remarks'];

    $table .= "<tr>";
    $table .= "<td>" .$project_id ."</td>"; 
    $table .= "<td>" .$project_name ."</td>"; 
    $table .= "<td>" .$project_lead ."</td>"; 
    $table .= "<td>" .$project_start ."</td>"; 
    $table .= "<td>" .$project_end ."</td>"; 
    $table .= "<td>" .$project_status ."</td>"; 
    $table .= "<td>" .$project_remarks ."</td>"; 
    $table .= "</tr>";

}
$table .= "</table>";
echo $table;
?>

What I currently have right now is something like thisenter image description here

What I want to have is instead of having each row displayed in one table, each row will have its on table.

enter image description here

  • 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-06T06:33:46+00:00Added an answer on June 6, 2026 at 6:33 am

    Just create a new table inside the while loop, that will create a new table for each SQL result row. Note, that you are also missing tr tags around the table headers (th)

    while($row = mysql_fetch_array($result))
    {
        $table .= "<table border='1'>"
        ."<tr><th>ProjectID</th>" 
        ."<th>Project name</th>" 
        ."<th>Lead</th>" 
        ."<th>Start</th>" 
        ."<th>End</th>" 
        ."<th>Status</th>" 
        ."<th>Remark</th></tr>";
    
    ...
    
        $table .= "<tr>";
        $table .= "<td>" .$project_id ."</td>"; 
        $table .= "<td>" .$project_name ."</td>"; 
        $table .= "<td>" .$project_lead ."</td>"; 
        $table .= "<td>" .$project_start ."</td>"; 
        $table .= "<td>" .$project_end ."</td>"; 
        $table .= "<td>" .$project_status ."</td>"; 
        $table .= "<td>" .$project_remarks ."</td>"; 
        $table .= "</tr>";
        $table .= "</table>";
    }
    
    echo $table;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables as shown in below image. Note: Lead column of projectheader
I have three tables: Employee , Emp_Address and Emp_AddressDetail . Employee table is master
I have three tables in my database. First table is Employee : Second table
I have three tables: Employee(Id,name etc) Appointment(Id,date,time,employee id, clientid etc) Client(Id,name etc) The Employee
I have two tables: Work Date Hours EmployeeId Employee EmployeeId EmployeeBossId EmployeeBossId refers to
I have three tables, Business: id name Office: id name business_id Employee: id name
I have two tables. Employee EmployeeID, EmployeeName, DocumentType and DocumentType DocumentTypeID, DocumentType There are
I have three tables. Product, Company, Employee ProductId of Product table is foregin key
I have three tables Employee SSN Name 1 a 2 b 3 c Projects
I have three tables. I have to retrieve the data using Linq statement. My

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.