Im trying to figure out how to do a select and check to see and of the values are set in my db and if so use SUM to add the new values to the old. Can someone give me so help in this matter. Right now i have just a simple insert.

PHP Code:
<?php
require("config.inc.php");
$results = array();
if (isset(
$_GET['parse'])) {

mysql_connect$cfg['dbHost'], $cfg['dbUser'], $cfg['dbPassword'] );
mysql_select_db$cfg['dbName'] );

    
/** open all logs in the directory and get the contents **/
 
    
foreach (glob('*.txt') as $strFilename) {
        if (
is_file($strFilename)) {

            
$strLog file_get_contents($strFilename);
            
$strLog str_replace( array("\n","\r\n"), "\r"$strLog );

            
preg_match_all'/-{40,}\r(.*?)\r-{40,}\r(.*?)\r/'$strLog$arrMatches );

            
/** build our array from the all the logs in the folder */

            
foreach( $arrMatches[1] as $strPlayers ) {
                
$arrPlayers explode("\r"$strPlayers);

                foreach( 
$arrPlayers as $strData ) {
                if (
$strData) {

                
$arrData preg_split('/[\s]+/'trim($strData));
                
$results[$arrData[0]][$arrData[1]]['kll'] = $arrData[2];
                
$results[$arrData[0]][$arrData[1]]['dth'] = $arrData[3];
                
$results[$arrData[0]][$arrData[1]]['sui'] = $arrData[4];
                
$results[$arrData[0]][$arrData[1]]['tk'] = $arrData[5];
                
$results[$arrData[0]][$arrData[1]]['net'] = $arrData[6];
                
$results[$arrData[0]][$arrData[1]]['eff'] = $arrData[7];
                
$results[$arrData[0]][$arrData[1]]['dg'] = $arrData[8];
                
$results[$arrData[0]][$arrData[1]]['dr'] = $arrData[9];
                
$results[$arrData[0]][$arrData[1]]['td'] = $arrData[10];
                
$results[$arrData[0]][$arrData[1]]['score'] = $arrData[11];

                
/** define the variables now and make the sql insert */

                
$team $arrData[0];
                
$player $arrData[1];
                
$kills $arrData[2];
                
$deaths $arrData[3];
                
$suicides $arrData[4];
                
$tk $arrData[5];
                
$net $arrData[6];
                
$eff round($arrData[7]);
                
$dg $arrData[8];
                
$dr $arrData[9];
                
$td $arrData[10];
                
$score $arrData[11];

                
$query ="INSERT INTO `players` ( `team`, `player` , `kills` , `deaths` , `suicides` , `tk` , `net` , `eff` , `dg` , `dr` , `td` , `score` ) VALUES ('$team', '$player', '$kills', '$deaths', '$suicides', '$tk', '$net', '$eff', '$dg', '$dr', '$td', '$score')";
                
mysql_query($query) or die (mysql_error().'<br/>'.$query);

  }
 }
}

/** deletes all logs in the directory after each one is parsed to avoid parsing twice **/ 

unlink($strFilename);
  }
 }
}
echo 
"<pre>";
var_dump($results);
echo 
"</pre>";
?>