I was going to say use a delete before the insert to make it cleaner, but it turns out REPLACE is the command you really want. It is probably the right command to use a lot of other times too, like adding/updating items...
REPLACE INTO items VALUES (%d,'%s');
A little more verbose, but it is suggested to name the columns, just incase the table changes.
REPLACE INTO items (id,raw_data) VALUES (%d,'%s');
__________________
Please read the forum rules and look at reacent messages before posting.
|