i couldn't find any working solution to this problem i want to update mi queryResult variable.
But when i do console.log(queryResult) outside of function it gives me like 50 lines of information about query but when i do console.log in function it print object with data what i need.
var queryResult; con.query('SELECT * FROM topics;', (err, result, fields) =>{ queryResult = result; return queryResult }); console.log(queryResult)