JREAM Posted June 25, 2009 Share Posted June 25, 2009 How do i make it so that it adds up every price? $sql = "SELECT price FROM projects"; $result = mysql_query($sql); while ($query = mysql_fetch_array($result)) { $price[] = $query; $total += $price; // is this bad? } Link to comment https://forums.phpfreaks.com/topic/163605-solved-add-variables-in-a-loop/ Share on other sites More sharing options...
JREAM Posted June 25, 2009 Author Share Posted June 25, 2009 I suppose ill just do SUM(price) for the SQL Link to comment https://forums.phpfreaks.com/topic/163605-solved-add-variables-in-a-loop/#findComment-863235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.