Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
PHP Server Side Scripting
9:59 am May 1, 2026
This page requires javascript.
Forum Moderators:
coopster
Message Too Old, No Replies
Add all mysql rows together that fit criteria
dkin
Msg#:1262716
5:39 am on Jan 12, 2005
(gmt 0)
is there a function I can use to run a mysql query that grabs all rows in a database that fit the criteria and adds them together?
dreamcatcher
Msg#:1262717
9:14 am on Jan 12, 2005
(gmt 0)
$query = mysql_query("SELECT SUM(row) as sum_total FROM table WHERE row = 'something'") or die(mysql_error());
$row = mysql_fetch_object($query);
echo $row->sum_total;
Think that should work ok.
dc
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
April 2026 Google Search Observations
what do they want?
SEO question
I need some SEO help
Hello again, it's been a while
Do you get tired of others copying your content?
iPhone Safari 26.4.1 errors: IPv4 & Host
5 SEO Tips That Actually Worked for My Blog in 2026
AdSense Earnings and Observations - April 2026
Home
Forums Index
Server Side
/
PHP Server Side Scripting
9:59 am May 1, 2026