Good friends I hope you can help me, I have the following table
CREATE TABLE 'almacen_articulo' (
'id' INT(4) NOT NULL AUTO_INCREMENT,
'existencia' VARCHAR(5) NOT NULL DEFAULT '0',
'id_articulo' VARCHAR(4) NOT NULL DEFAULT '0',
'id_almacen' VARCHAR(4) NOT NULL DEFAULT '0',
'existencia_comprome' VARCHAR(5) NOT NULL DEFAULT '0',
PRIMARY KEY ('id')
)
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM
AUTO_INCREMENT=4
;
these are the data they contain
My intention is to make a insert of article 85 in store 2 if not, otherwise if it already exists in that store update its existence
I have tried this query but keep doing the insert instead of updating it
INSERT INTO almacen_articulo (id_articulo,id_almacen,existencia) VALUES(85, 2, 100) ON DUPLICATE KEY UPDATE id_articulo=85, id_almacen=2, existencia=100