While reading and article came across one of powerful feature REPLACE INTO,I had used INSERT ON DUPLICATE KEY UPDATE but never used REPLACE INTO.
REPLACE works in a way that if the ID column(Primary Column) doesn't have the given value it will create a new entry in the table, however, IF the value exists already then it updates the existing entry in the table.
REPLACE INTO sessions VALUES ('$id', '$data', $ts).
Read about REPLACE INTO and Difference about INSERT ON DUPLICATE KEY UPDATE vs REPLACE INTO
Wednesday, July 22, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment