Create if an entry if it doesn't exist, otherwise update?
Kinda strange to put it into words that short, heh.
Anyway, what I want is basically to update an entry in a table if it does exist, otherwise to create a new one filling it with the same data.
I know that’s easy, but I’m relatively new to MySQL in terms of how much I’ve used it 😛
Use ‘REPLACE INTO’:
REPLACE INTO table SET id = 42, foo = 'bar';
See more in the MySQL documentation
Answered By – carl