lpxxfaintxx Posted May 31, 2006 Share Posted May 31, 2006 Hello, I haven't coded in PHP in a long time.. good to be back. I have a question.. I own a game site, www.buzzingames.com. In it, it keeps record of the amount of games played each [i]day[/i]. How do I select the data from them and ADD the numbers up?[img src=\"http://img.photobucket.com/albums/v216/lpxxfaintxx/phphelp.jpg\" border=\"0\" alt=\"IPB Image\" /]Regards Quote Link to comment https://forums.phpfreaks.com/topic/10847-adding-numbers-with-php-and-mysql/ Share on other sites More sharing options...
appeland Posted May 31, 2006 Share Posted May 31, 2006 Hello,you may use[code]SELECT SUM(GamesPlayed) FROM gamestoday[/code]Cheers,Andi Quote Link to comment https://forums.phpfreaks.com/topic/10847-adding-numbers-with-php-and-mysql/#findComment-40527 Share on other sites More sharing options...
lpxxfaintxx Posted June 1, 2006 Author Share Posted June 1, 2006 How will I echo out the results? Quote Link to comment https://forums.phpfreaks.com/topic/10847-adding-numbers-with-php-and-mysql/#findComment-40768 Share on other sites More sharing options...
samshel Posted June 1, 2006 Share Posted June 1, 2006 $result = mysql_query("SELECT SUM(GamesPlayed) as total_plays FROM gamestoday");$row = mysql_fetch_array($result);echo $row['total_plays']; Quote Link to comment https://forums.phpfreaks.com/topic/10847-adding-numbers-with-php-and-mysql/#findComment-40860 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.