Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mysql = require('mysql');
- var con = mysql.createConnection({
- host: "localhost",
- port: "8080",
- user: "root",
- password: "pass",
- database: "db"
- });
- createNewProfile = function (firstName, lastName, type, isActive, securityClearance, location)
- {
- var newID;
- var sql = "CALL create_new_profile_id";
- con.connect(function(err)
- {
- if(err) throw(err, "Connection to database for creating new profile failed.");
- con.query(sql, function(err, results)
- {
- if(err)
- {
- console.log(err.message);
- throw (err, "create_new_profile_id filed.");//this is where the error occurs
- }//if
- newID = results;
- });
- //some more function calls to do other things with the profile
- });//connect
- con.end(function(err){
- if (err) throw err;
- console.log("Connection closed.");
- });
- }//create new profile
Add Comment
Please, Sign In to add comment