You have to use UPDATE instead of INSERT:
For Example:
UPDATE table1 SET col_a="k1", col_b='foo' WHERE key_col="1";
UPDATE table1 SET col_a="k2", col_b='bar' WHERE key_col="2";
More Related Contents:
- Insert into a MySQL table or update if exists
- INSERT INTO … SELECT FROM … ON DUPLICATE KEY UPDATE
- MySQL trigger On Insert/Update events
- Recreating a query using INNER JOIN? [duplicate]
- Create a Cumulative Sum Column in MySQL
- Equivalent of explode() to work with strings in MySQL
- 1064 error in CREATE TABLE … TYPE=MYISAM
- mysql select dynamic row values as column names, another column as value
- Access denied for user ‘root’@’localhost’ (using password: YES) (Mysql::Error)
- Setting up MySQL and importing dump within Dockerfile
- MySQL DELETE FROM with subquery as condition
- SQL – IF EXISTS UPDATE ELSE INSERT INTO
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- Simple Random Samples from a Sql database
- node.js mysql error: ECONNREFUSED
- Relational database design multiple user types
- Checking multiple columns for one value
- What is better in MYSQL count(*) or count(1)?
- How to deploy local MySQL database to Heroku
- Should I use MySQL blob field type?
- MySQL Cannot drop index needed in a foreign key constraint
- MySQL Insert & Joins
- Does MySQL overwrite a column of same value on update?
- How to make join queries using Sequelize on Node.js
- mysql like performance boost
- MySQL selecting yesterday’s date
- Does MySQL included with MAMP not include a config file?
- How do I write an SP in phpMyAdmin (MySQL)?
- GRANT with database name wildcard in MySQL?
- Composite Primary Key performance drawback in MySQL