Solved

php mssql

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Problem Description:   Couple of months ago we upgraded the ADSL line at our branch office from Home to Business line. The purpose of transforming the service to have static public IP’s. We were in need for public IP’s to publish our web resour…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now