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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:42:24+00:00 2026-06-17T07:42:24+00:00

I want to pull columns from two different tables next to each other. I

  • 0

I want to pull columns from two different tables next to each other.

I have php code as below :

<table>
 <tr>
<th>Date</th>
<th>Performance A </th>
<th>Performance B </th>
</tr>
$sql = "select date, Aperformance from table1 group by date";
$sql1 = "select date, Bperformance from table2 group by date";
$result = mssql_query($sql);
while ($column = mssql_fetch_array($result))

{
echo "<tr><td>".$column[0]."</td>";
echo "<td>".$column[1]."</td></tr>";
}

And this produces output as below :

 Date     | Performance A | Performance B
 01/05/12 | 40%           | 
 02/05/12 | 30%           |
 03/05/12 | 25%           |

Now I want to fill up the third column from query $sql1. I don’t want date column from $sql1, the second column Bperformance needs to put in here. How I can 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-17T07:42:26+00:00Added an answer on June 17, 2026 at 7:42 am

    Assuming both queries return the same number of rows, you could simply do:

    $result1 = mssql_query($sql);
    $result2 = mssql_query($sql2);
    while($column1 = mssql_fetch_array($result1)) {
        $column2 = mssql_fetch_array($result2);
        echo "<tr><td>$column1[0]</td><td>$column2[0]</td></tr>";
    }
    

    If the queries return different sized result sets, then you’ll have do some extra work.

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

Sidebar

Related Questions

I want to bind columns in a DataGridView to pull values from two different
I have a multidocument application. I want to pull data from each of those
I am trying to pull multiple columns from 3 joined tables, but I want
I have these two different queries. This query pulls the records from posts table
I have a remote monotone repos I want to pull from, but I really
Basically, I have multiple URL's stored in a MySQL table. I want to pull
I have two tables holding game data for two different games. For the sake
I have two tables, meetings_table and items_table . items_table has three columns: id item
I am doing a join between two tables and want to select the columns
I have two tables photo and sale . photo has two columns id and

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.