Created
December 1, 2018 04:22
-
-
Save ErMandeep/2d6640464cea74ef6fc940919bf726bc to your computer and use it in GitHub Desktop.
Get sum of MySQL column in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = mysql_query('SELECT SUM(value) AS value_sum FROM codes'); | |
$row = mysql_fetch_assoc($result); | |
$sum = $row['value_sum']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment