vexious Posted December 14, 2007 Share Posted December 14, 2007 Im a real newb... I have a table that looks like this: CREATE TABLE `totalrequest` ( `user` int(11) NOT NULL default '0', `name` VARCHAR(100) NOT NULL default '0', `count` int(11) NOT NULL default '0', `time` int(11) NOT NULL default '0' I have about 2,000 entries total, what i want to do is create a bit of code to count the count field... The count field can range from 0-90.. Basically what i want to do is have a bit of php code that will display the total of the count rows.... So i just want it to add them all.. so if i have 5... 0,0,4,20,20 it would display 44.. =\ I'm lost how to even start this Link to comment https://forums.phpfreaks.com/topic/81596-newbie-question/ Share on other sites More sharing options...
fenway Posted December 14, 2007 Share Posted December 14, 2007 You mean a SUM() function? Link to comment https://forums.phpfreaks.com/topic/81596-newbie-question/#findComment-414450 Share on other sites More sharing options...
vexious Posted December 14, 2007 Author Share Posted December 14, 2007 Yah Link to comment https://forums.phpfreaks.com/topic/81596-newbie-question/#findComment-414464 Share on other sites More sharing options...
fenway Posted December 14, 2007 Share Posted December 14, 2007 SELECT SUM(`count`) FROM totalrequest But I wouldn't use function names for column names. Link to comment https://forums.phpfreaks.com/topic/81596-newbie-question/#findComment-414834 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.