473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

how to sum the total of the column

29
dear all,
can some 1 help me in saving the problem of

total all the amount
and print in a table form with all the detail?
using php and mysql.

thz.
Jul 28 '09 #1
5 7187
vikas1111
122 100+
@dreamy
Can you be more specific ?
Jul 28 '09 #2
Dormilich
8,658 Expert Mod 8TB
tip: check out MySQL's SUM() function.
Jul 28 '09 #3
dreamy
29
ok,
i have try
<?
total=0;
$total += $row['amount'];
print $total;
?>

and it can total up all the value.
but it print every line.

how can i print under the column?
Jul 29 '09 #4
Dormilich
8,658 Expert Mod 8TB
@dreamy
if you put the print command inside the while loop that's only natural.

using the sum() function in your sql query prevents that because you only have one "row".
Jul 29 '09 #5
dreamy
29
ok, i try it.
thz dormilich
Jul 29 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: thejackofall | last post by:
Hi. I am trying to calculate the total of a column in a datagrid. The amounts display fine on the grid, but the value of each cell is "" when DataGrid1_ItemDataBound is called. A funny thing...
1
by: Manal/report designer | last post by:
Thank you in advance for any suggestions... I'm using crystal reports version 8 & SQL server. I've created a report that is composed of 2 parts: 1st part contains the mainreport which uses...
2
by: mhodkin | last post by:
I created a query in which I have grouped data by City. I wish to calculate the percent of each value, e.g. City/(Total count of all Cities), in tbe next column of the query. I can't seem to...
5
by: Jon Lapham | last post by:
I have been using the EXPLAIN ANALYZE command to debug some performance bottlenecks in my database. In doing so, I have found an oddity (to me anyway). The "19ms" total runtime reported below...
5
by: Daedalus | last post by:
I need to make it so that a DB of a membership list I have can send the sum value of a column to a cell in a Excel spreadsheet. Basically: I have in Access a membership database which, among...
0
by: =?Utf-8?B?SEdK?= | last post by:
I am looking for a beter way to show column total at the bottom of a DataGridView. The way I've done by setting labels at outside the bottom of the DataGridView and show the total values in the...
4
by: drago | last post by:
Hi guys, I will be quick this time... Just want to know how we can calculate generic values in the same column. I am using invoice form with a services subform . I have a column of 'total' in subform...
6
convexcube
by: convexcube | last post by:
After searching the web for a solution to total a specific column in a list box and not finding it, I came up with this: Dim varTotal As Currency Dim varRow As Integer For varRow = 1 To...
1
by: erics44 | last post by:
Hi I have a Matrix in a report and i want the total column to sum a different field that is in the column group, is there any way of doing this? here is an example of my matrix ...
5
by: mabrynda | last post by:
Hi, Is there any possibility to sum all the values in many (say n) columns in a single table using VBA in access 2003? Say I have a table with 200 columns. Say the table name is TableCOUNT and the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.