Topic: (My)SQL help
OK... so I have a small problem
As some of you know, I'm working on a game, Cosmic Command.
I'm working on building units, but the problem is, they're supposed to be dynamic. So I don't have a column in my ships table for each unit, but I have a table that holds all units a ship has.
Here for my problem:
On unit creation, I want to attempt updating an existing value, and if that fails, insert a new row. A bit like the insert into ... on duplicate key update query, but in reverse.
Or should I just add a row at ship creation with the amount at 0?
Help would be appreciated!
-- Bekko