Solved

php mssql

Posted on 2013-01-03
2
402 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
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

860 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