1

I Used node.js and mysql. i Made callback function in mysql query callback.

exports.callback = function(req) 
{
....
    Mysqldb.pool.getConnection(function(err, db) {
        db.query("select * from tbl"), function (err,rows) {      
          db.query("update tbl set id = 1"), function (err, rows){
          }); //update tbl
       });//select tbl
    }); //getconnection
}; //export.callback

Error is update query callback.... error message is

TypeError: this._callback.apply is not a function
at Query.Sequence.end (c:\redfox_server_src\node_modules\mysql\lib\protocol\sequences\Sequence.js:96:24)
at Query.ErrorPacket (c:\redfox_server_src\node_modules\mysql\lib\protocol\sequences\Query.js:94:8)
at Protocol._parsePacket (c:\redfox_server_src\node_modules\mysql\lib\protocol\Protocol.js:274:23)
at Parser.write (c:\redfox_server_src\node_modules\mysql\lib\protocol\Parser.js:77:12)
at Protocol.write (c:\redfox_server_src\node_modules\mysql\lib\protocol\Protocol.js:39:16)
at Socket.<anonymous> (c:\redfox_server_src\node_modules\mysql\lib\Connection.js:96:28)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)

please help me..

1 Answer 1

2

You missed a double quotation mark here.

Wrong:

db.query("select * from tbl)

Right:

db.query("select * from tbl")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.