RR
Deno3y ago
4 replies
R

mysql query is skipped

Hi,
I have a function that should retrieve data from the database and then process and return it. The function is however skipping the query and returning undefined.
This is the query:
function getUser(name) {
    client.query(`SELECT * FROM users WHERE name=? LIMIT 1`, [name]).then(data => {
  // I want it to process and return the user data
})
// But it skips the query and returns undefined 
}
Was this page helpful?