View Single Post
  #3  
Old 01-04-2003, 01:30 PM
Lurker_005
Demi-God
 
Join Date: Jan 2002
Location: Tourist town USA
Posts: 1,671
Default

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.
Reply With Quote