grlayouts Posted March 21, 2007 Share Posted March 21, 2007 ok i have the fields in my database user amount Admin 5 Admin2 7 how do i display the total of ammount? ie = 12 Link to comment https://forums.phpfreaks.com/topic/43681-display-ammount/ Share on other sites More sharing options...
per1os Posted March 21, 2007 Share Posted March 21, 2007 SELECT SUM(amount) FROM tablename; Link to comment https://forums.phpfreaks.com/topic/43681-display-ammount/#findComment-212045 Share on other sites More sharing options...
Orio Posted March 21, 2007 Share Posted March 21, 2007 <?php $result = mysql_query("SELECT SUM(amount) AS sum FROM `table`"); $data = mysql_fetch_array($result); echo $data['sum']; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/43681-display-ammount/#findComment-212048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.