In message <[EMAIL PROTECTED]>, Brian E Boothe
<[EMAIL PROTECTED]> writes
>
>i have three Values in each row of my MySQL database, im needing to sum
>them in the table as they are displayed per Row ??   how do i do this  ?
>
>Projectname     Elecremain   Controlremain    otherremain              
><?php ?>
>  Project1             2300             1600                    
>250              <?php  (Sum) ?>
>  Project2             4300             600                      
>150             <?php  (Sum) ?>

SELECT Elecremain, Controlremain, otherremain, Elecremain+Controlremain+
otherremain as total from mytable

Your use of the word sum may be confusing you here, the MySQL SUM()
function is for columns, not rows.  Which is why I have used the name
"total"

--
Pete Clark

Free advertising for your website, business, or organisation at:
http://www.hotcosta.com/resources.php




The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning.



YAHOO! GROUPS LINKS




Reply via email to