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

148
Views
How to suppress column headers from query output

When i run the query it outputs the column names(headers) along with the results which is a problem since i need a result only output. I've seen the mysql -N -e option that may fix the problem, is there a way to implement -N -e into my connection?

const mysql = require("mysql2");
const connection = mysql.createConnection({
host: "localhost",
database: "mydb",
user: "root",
password: "password1"
});

connection.query(
"SELECT iso2,cases FROM mydb WHERE dates='" + pickedDate + "';",
function (err, results, fields) {
const filePath = path.join(__dirname, "data", "pickedDate.json");
const fileData = fs.readFileSync(filePath);
const storedDates = JSON.parse(fileData);
storedDates.push(results);
fs.writeFileSync(filePath, JSON.stringify(storedDates));
});
about 4 years ago · Santiago Trujillo
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!