I have a query that receives data from a .csv and inserts the data into the table.
If position
is the same it updates the fields. I need to verify that position
is different from 1 ( status
) in order to update.
This status <> 1
is not passed by .csv is only registered in the database and I can not update the records that are with status
.
How to do this?
$import=
"INSERT INTO registros (NAME, position, price)
VALUES
(
'$data[1]',
'$data[2]',
'$data[3]'
) ON DUPLICATE KEY UPDATE position = position,
NAME = '$data[1]',
position = '$data[2]',
price = '$data[3]',
qty_try = 0";