How to access a RowDataPacket object

前端 未结 14 2341
悲&欢浪女
悲&欢浪女 2020-11-29 03:02

I\'m currently developing a desktop application with Node-webkit. During that process I need to get some data from a local MySQL-database.

The querying works fine, b

相关标签:
14条回答
  • 2020-11-29 03:23

    Hi try this 100% works:

    results=JSON.parse(JSON.stringify(results))
    doStuffwithTheResult(results); 
    
    0 讨论(0)
  • 2020-11-29 03:27

    you try the code which gives JSON without rowdatapacket:

    var ret = [];
    conn.query(SQLquery, function(err, rows, fields) {
        if (err)
            alert("...");
        else {
            ret = JSON.stringify(rows);
        }
        doStuffwithTheResult(ret);
    }
    
    0 讨论(0)
提交回复
热议问题