Possible Duplicate:
How do I update if exists, insert if not (aka upsert or merge) in MySQL?
I am creating a simple crawler gathering statistics from website. What I want to do is that if there is no record crawled from URL then insert to database, otherwise update the existing record, but I am not really sure how to do this without using php to
SELECT * from table where url='somevalue';
and if there is no record
INSERT INTO...
otherwise
UPDATE...