I want to update a record which may or may not be present in a table. If it is not present in the database then it will be inserted.
To prevent from select I am using UPDATE
statement first and checking affected_rows > 0
if not then I am inserting this record into the table.
I was wondering if there is a better way to do this?