Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

php mssql

Posted on 2013-01-03
2
Medium Priority
?
407 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 2000 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

Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
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 dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

971 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