This is more of a MySQL question, but I am sure someone out there will know an answer.
Is there and easy way to insert/update a record in a mysql table depending upon whether or not the record exists?
i.e.
if ($id exists in table) { update field=value where id=$id }
else { insert into table id=$id, field=$value }
At the moment I am doing a select and then using a perl if statement to determine if it should update or insert.