Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
How to get result from Sql query outside a function in express.js?

I was working in on Express.js with mysql. I need the json result from mysql query to be return value of the function.

intelligenceTopic()

function intelligenceTopic() {
  let query = 'SELECT I.intelligence_type,T.topic,T.topic_code FROM topic T INNER JOIN intelligence I ON T.intelligence_id=I.id GROUP BY T.topic_code;';
  var intelligence;
  database.query(query, (err, result) => {
    if (err) throw err;
    intelligence = result;
  });
  return intelligence;
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!