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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -