I have a while loop like below. I want to sum all of the fields from the database, but ignore a set few. These are called id, summary and diff.
I have setup what I think I need below, but do not know how to compare the current key to these field names correctly.
$sql = 'SELECT * FROM table';
$result = mysql_query($sql)
while ($row = mysql_fetch_array($result)){
//DOES KEY = an ignore field name?
//If No
$i++
}
1 Answer