Sunday, 30 April 2017

How to use SQLite3 to iterate through all results of a query to database

I'm having difficulty interpreting documentation on this but I currently have a database and I want to iterate through all the elements of a query in a Node.js application using a sqlite3 database.

Is the below how I would access the entry of each row?

var query = conn.query(sql, function(error, result){ //sql is a predefined sql statement

    for (var i = 0; i < result.rowCount; i++) {

        result.rows[i];
        }

} );



via learner561

No comments:

Post a Comment