Orderby condition in node js mysql

A. asc order var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "nodejs" }); con.connect(function(err) { if (err) throw err; con.query("SELECT * FROM customers…

0 Comments

Where condition in node js mysql

A. Fetch data with where() condition var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "nodejs" }); con.connect(function(err) { if (err) throw err; con.query("SELECT…

0 Comments

Select data from mysql database using node js

A. Fetch data without condition var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "nodejs" }); con.connect(function(err) { if (err) throw err; con.query("SELECT *…

0 Comments

Insert data using node js mysql

var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "nodejs" }); con.connect(function(err) { if (err) throw err; console.log("Connected!"); var sql = "INSERT INTO customers…

0 Comments

Create table using nodejs

var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "nodejs" }); con.connect(function(err) { if (err) throw err; console.log("Connected!"); var sql = "CREATE TABLE members…

0 Comments

Create database using nodejs

var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "" }); con.connect(function(err) { if (err) throw err; console.log("Connected!"); con.query("CREATE DATABASE nodedb", function (err, result) { if…

0 Comments

Node js mysql

npm install mysql var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "" }); con.connect(function(err) { if (err) throw err; console.log("Connected!"); });  

0 Comments