|
|
@ -335,15 +335,13 @@ exports.mysqlQuery = function (connectionString, query) {
|
|
|
|
connection.query(query, (err, res) => {
|
|
|
|
connection.query(query, (err, res) => {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
reject(err);
|
|
|
|
reject(err);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
// Check if res is an array
|
|
|
|
|
|
|
|
if (Array.isArray(res)) {
|
|
|
|
if (Array.isArray(res)) {
|
|
|
|
resolve("Rows: " + res.length);
|
|
|
|
resolve("Rows: " + res.length);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
resolve("No Error, but the result is not an array. Type: " + typeof res);
|
|
|
|
resolve("No Error, but the result is not an array. Type: " + typeof res);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
connection.destroy();
|
|
|
|
connection.destroy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|