i want to get the location from specific user and when i run this code it gets me error ' Uncaught TypeError: Cannot read property 'location' of undefined ' and i dont know how i can fixed. this is the code :
db.transaction(function(tx){
tx.executeSql("SELECT location FROM users WHERE username='"+username+"'",[], success );
});
function success(tx,results){
var city = results.rows.item[0].location;
}
-
Please make the example code a minimal, complete, verifiable example.bignose– bignose2016年04月03日 19:58:21 +00:00Commented Apr 3, 2016 at 19:58
1 Answer 1
You're using square brackets instead of parentheses when you call item on results.rows.
Sign up to request clarification or add additional context in comments.
1 Comment
Pedro
No problem. Please select this as the answer and have a good day! :-)
default