var pool = openConnectionToDB(host,username,password,database);
pool.getConnection(function(err,connection){
console.log('connected as id ' + connection.threadId);
//Query
connection.query("SELECT * FROM ?? WHERE ?? = ? AND deleted_at IS NULL",['table_name','id',subject],function(err,rows){
if(!err) {
if(typeof rows[0] == 'undefined'){
connection.release();
connection.destroy();
}
}
});
});
pool.getConnection(function(err,connection){
console.log('connected as id ' + connection.threadId);
//Query
connection.query("SELECT * FROM ?? WHERE ?? = ? AND deleted_at IS NULL",['table_name','id',subject],function(err,rows){
if(!err) {
if(typeof rows[0] == 'undefined'){
connection.release();
connection.destroy();
}
}
});
});
No comments:
Post a Comment