0
I’d like him to pass one return
with only the number of data of that table, however it is returning it:
C:\E. S>node dao.js Connected! [ RowDataPacket { 'COUNT(*)': 4 } ]
Code:
contaQuantidade(tabela){
var conector = this.conectaBanco();
conector.connect(function(err) {
if (err) throw err;
console.log("Connected!");
conector.query("select COUNT(*) from "+tabela, function (err, result) {
if (err) throw err;
var i = result;
});
conector.end();
});
return i;
}
How do I pick only the number 4
?