Answer the question
In order to leave comments, you need to log in
How to refer to an element of an object in nodejs?
After querying the database, I get an object [ RowDataPacket { id: 1, login: 'Uri', password: '9696GORYACHEV' } ]
how to display just id?
Tried i[id]/i['id'] - doesn't display
Trying
for(var kay in i) {
var w = i[kay];
response.send(w);
}
events.js:180 thrower
; // Unhandled 'error' event
^
Error: Connection lost: The server closed the connection.
at Protocol.end (W:\domains\mysql1\node_modules\mysql\lib\protocol\Protocol.js:112:13)
at Socket. (W:\domains\mysql1\node_modules\mysql\lib\Connection.js:97:28)
at Socket. (W:\domains\mysql1\node_modules\mysql\lib\Connection.js:525:10)
at Socket.emit (events.js:208:15)
at endReadableNT (_stream_readable.js:1161:12)
at processTicksAndRejections (internal /process/task_queues.js:77:11)
Emitted 'error' event at:
at Connection._handleProtocolError (W:\domains\mysql1\node_modules\mysql\lib\Connection.js:426:8)
at Protocol.emit (events.js:203:13)
at Protocol._delegateError (W:\domains\mysql1\node_modules\mysql\lib\protocol\Protocol.js:398:10)
at Protocol.end (W:\domains \mysql1\node_modules\mysql\lib\protocol\Protocol.js:116:8)
at Socket. (W:\domains\mysql1\node_modules\mysql\lib\Connection.js:97:28)
[... lines matching original stack trace ...]
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
fatal: true,
code: 'PROTOCOL_CONNECTION_LOST'
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question