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 Quote 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? Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/81596-newbie-question/#findComment-414834 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.