Solved

php mssql

Posted on 2013-01-03
2
405 Views
Last Modified: 2013-01-03
Have a connection to a mssql database
I have got it talking and pulling in the data which I have use mssql_query
and mssql_fetch_assoc
 I use this statement to show the results
//header

    if (!$header) {
        echo '<thead>';
        echo '<tr>';
       for ($i = 1; ($i + 1) <= mssql_num_fields($data); ++$i) {
            echo '<td>' . ucfirst($row[$i]) .ucfirst($row[$i]) . '</td>';
			}
        echo '</tr>';
        echo '</thead>';
        echo '<tbody>';
       $header = true;
    }
// row
    echo '<tr>';
    foreach($row as $value) {
        echo '<td>' . $value . '</td>';
    }
    echo '</tr>';
}
echo '</tbody>';
echo '</table>';   

Open in new window


the sql statement select two fields and in a SUM(coloumn1), and SUM (coloumn2)
but I now want to add these two values together
0
Comment
Question by:beridius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 38739457
what is your query

You can do it in query itself.. share your query

select sum(col1) + sum(col2)  From table name

group by columns
0
 
LVL 2

Author Closing Comment

by:beridius
ID: 38739487
changed the query from array to assoc works fine thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Getting hacked is no longer a matter or "if you get hacked" — the 2016 cyber threat landscape is now titled "when you get hacked." When it happens — will you be proactive, or reactive?
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question