php - MySQL - Can 'INSERT INTO - ON DUPLICATE KEY UPDATE' cause data loss -
i have caching script requests bunch of data soap api using php (cron job every 5 minutes). script requests , stores customer id
, name
.
the table api information stored in has 3 columns:
'id' = int, primary_key 'name' = varchar(255) 'paying' = bool
there around 10 (in 80) customers bool paying
set true. however, every once in while customer's paying
columns revert 0
.
so... can following query cause paying
column change under circumstances?
insert customer(`id`, `name`) values ('$escapedid','$escapedname') on duplicate key update `name`='$escapedname'
this query couldn't change 'paying' field state.
therefore, reason other code either setting value 0, or deleting records.
Comments
Post a Comment