Solved

php mssql

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
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.
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

749 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