70
rated 0 times
[
71]
[
1]
/ answers: 1 / hits: 18911
/ 9 Years ago, wed, july 15, 2015, 12:00:00
Im using node
and npm mysql
to do some database work.
Is there any way to avoid using the result[0]
, if i know Im only going to receive a single row?
connection.query({
sql: SELECT spend FROM `account` WHERE `name` = ? order by date desc limit 1,
values: [market.name]
}, function (error, results, fields) {
market.fee = results[0].age;
resolve(market);
});
More From » mysql