if you are using mysql server >= v4.1 you can do this with one query.
example how i do in my plugins:
create a table with an unique field "name":
Code:
CREATE TABLE `something` (`name` VARCHAR(32), `points` INT NOT NULL, PRIMARY KEY(`name`))
insert a name or if it exists update only the points:
Code:
INSERT INTO `something` (`name`,`points`) VALUES ('player',10) ON DUPLICATE KEY UPDATE `points`=100
run the insert query twice and you will see, first the player is inserted with 10 points and second the points will be set to 100
__________________