I would like to send a value via the variable numOfComment when the comment grater than the previous one. I got answer when I put inside the query but it's not work outside of query. I can't also continue/break it inside the query. Please help me
if(domainName.includes(givenUrl)){
tmpDomain = domainName;
con.query("SELECT comment FROM comments WHERE domain=?", tmpDomain, function(err, result, feild){
tmpNumOfComment = result.length;
if(tmpNumOfComment>numOfComment){
numOfComment = tmpNumOfComment;
}
});
console.log('Number Of Comment : '+numOfComment);
}