not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
1.1 KiB

const mysql = require('mysql');
const sanitizer = require('sanitizer');
var Promise = require('promise');
module.exports=
{
/**
* Function used to use insert statements into the database
*
* Don't worry, the input gets sanitized
*
* @param sqlStatement
* @return the id of the new record - if there is one
*/
insert : function(sqlStatement)
{
return new Promise(function(resolve, reject)
{
con.query(sanitizer.sanitize(sqlStatement), function (err, result)
{
if (err)
{
console.log(err);
resolve(0);
}
resolve(result.insertId);
});
})
},
/**
* Insert all of the user's data into the sql database
* @param player
*/
insertData : function(player)
{
return new Promise(function(resolve, reject)
{
var q = "";
})
}
};