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

197
Views
How do i use multiple query in node.js , discord.js

I want to extract mysql data to other function but i can't use because of that value is local varation so i find multiple query but if i using multiple query, i can't get data in field

piecoin = 100 cakecoin = 500

else if (command === "buy") {
  var query = `select piecoin from coin;`;

  database.query(query, (err, coin, field) => {
    if (err) {
      console.log(err);
    } else {
      console.log(coin[0].piecoin);
    }
  });

I can get result "100" but if i use multiple query like this

else if (command === "buy") {
  var query = `select piecoin from coin;` + `select cakecoin from coin;`;

  database.query(query, (err, coin, field) => {
    if (err) {
      console.log(err);
    } else {
      console.log(coin[0].piecoin);
    }
  });

Result is "undefined" or if i run console.log(coin[0]);

i can get [ RowDataPacket { piecoin: 100 } ] like this i want to get value in field

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!