I assume your talking about phprenbot here?
Anyway, assuming your using PHP with a MySQL database, and ignoring the connection to the database code.
Code to increment a counter each time a name is seen.. code is case-insensitive.
$playerNameQuery = mysql_query ( "SELECT * FROM players WHERE LOWER(name) = \"" . lc($playerName) . "\"" );
if ( mysql_num_rows ( $playerNameQuery ) > 0 )
{
$playerData = mysql_fetch_assoc ( $playerNameQuery );
mysql_query ( "UPDATE players SET timesSeen = (timeSeen+1) WHERE name = \"" . $playerData['name'] . "\"" );
}
else
{
mysql_query ( "INSERT INTO players ( name, timeSeen ) VALUES ( \"" . lc($playerName) . "\", 1, )" );
}