mysqldb.js

1.1.0 • Public • Published

MySqlDB

The MySqlDB Class Library is a high level wrapper around the MySql.

Node.js (Install)

Requirements:

  • Node.js
  • npm (Node.js package manager)
npm install mysqldb.js

Usage

Including all libraries, for access to extra methods:

var MySqlConnection = require('mysqldb.js');

var server   = "localhost";
var port     = 3306;
var database = "mydb";
var username = "root";
var password = "";

//var mysql = new MySqlConnection(connectionString);
var mysql = new MySqlConnection(server, port, database, username, password);

var sql = "SELECT name, surname, email FROM posts ORDER BY name;";

// if connection is successful
mysql.sql_query(sql, function (err, result, fields) {
  // if any error while executing above query, throw error
  if (err) throw err;
  // if there is no error, you have the result
  console.log([result]);
});

Package Sidebar

Install

npm i mysqldb.js

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

4.31 kB

Total Files

4

Last publish

Collaborators

  • michelerosica