How to update value "100" If the $id duplicate by adding +100 to it so the total will be 200 in the level here is my INSERT statement
INSERT INTO users (id, name, level) VALUES ($id, 'name', 100 )
Since UPDATE is MySQL specific the more generic way is to do
INSERT INTO users (id,name,level) VALUES ($id, 'name', 100)
ON DUPLICATE KEY UPDATE level = level + VALUES(level)
See http://dev.mysql.com/doc/refman/5.1/de/insert-on-duplicate.html AFAIK this is more generally applicable then only on MySQL.