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 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 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? 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']; 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
Archived
This topic is now archived and is closed to further replies.