function GetDBData(query) {
	return mysql.createConnection({
		host:constants.host,
		user:constants.user,
		password:constants.password,
		database:constants.database
	}).then(function(conn){
		connection = conn;
		return connection.query(query);
	}).then(function(results){
		connection.end();
		//console.log(JSON.stringify(results));
		//console.log(results);
		return results;
	});
}
//helper function to access to MySQL
helper function to access to MySQL
helper function to access to MySQL
function GetDBData(query) {
	return mysql.createConnection({
		host:constants.host,
		user:constants.user,
		password:constants.password,
		database:constants.database
	}).then(function(conn){
		connection = conn;
		return connection.query(query);
	}).then(function(results){
		connection.end();
		return results;
	});
}
function GetDBData ( query ) { return mysql . createConnection ( { host : constants . host , user : constants . user , password : constants . password , database : constants . database } ) . then ( function ( conn ) { connection = conn ; return connection . query ( query ) ; } ) . then ( function ( results ) { connection . end ( ) ; return results ; } ) ; }
helper function to access to MySQL
helper function to access to MySQL
//console.log(JSON.stringify(results)); //console.log(results);