Nodejs MySQL Update Records

Node.js MySQL Update Records

Database record can be updated using the “UPDATE” statement.

Example :- Let’s update “emp_salary” in  “employees” table where “id” is 5.

Step 1:-  Let’s, create a node_mysql_update_tbl.js file and put the following code in it –

Step 2:- Save the code and open the terminal again, and type the following command in order to run the file.

you will see following output on terminal –

Node.js MySQL Update Records 1

Node.js MySQL Update Records 1

Before Update –

Node.js MySQL Update Records 2

Node.js MySQL Update Records 2

After Update –

Node.js MySQL Update Records 3

Node.js MySQL Update Records 3