SHARE
TWEET

Untitled

a guest Jun 25th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mysql = require('mysql');
  2.  
  3. var con = mysql.createConnection({
  4.   host: "localhost",
  5.   user: "root",
  6.   password: "" ,
  7.   database: "locator"
  8. });
  9.  
  10.   con.connect(function(err) {
  11.     if (err) throw err;
  12.     console.log("Connected!");
  13.     var sql = "INSERT INTO location (longitude,latitude) VALUES ('21.2985', '268598.6545')";
  14.     con.query(sql, function (err, result) {
  15.       if (err) throw err;
  16.       console.log("1 record inserted");
  17.     });
  18.   });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top