Not sure if Im just missing the obvious here, but this is my dilemma. Im running an UPDATE query, similar to this: If domain123.com is in the table, this simply adds 1 to its hits_in counter..... simple. But if the domain is not there, I wanna run an INSERT query that would add that domain to the DB. Currently, Im running a SELECT query to see if the domain is there or not, and then decide if I should run UPDATE or INSERT. Im trying to get rid of the SELECT query, since 99.9% of the time, I would need to run the UPDATE query, since the domain would already be in the DB. How would I make it run the INSERT query in the remaining 0.01% of the cases when the UPDATE query doesn't update any rows.