Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Last active December 27, 2015 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IuryAlves/7274421 to your computer and use it in GitHub Desktop.
Save IuryAlves/7274421 to your computer and use it in GitHub Desktop.
var datas;
db.transaction(function(transaction){
transaction.executeSql('SELECT * FROM Comics WHERE name = ? ',
[["batman"]],
function(transaction,result){
for(var i = 0; i < result.rows.length;i++){
datas = result.rows.item(i)['name'];
}
},
function(transaction,error){
console.log(error);
})
});
console.log(datas); // outputs undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment