I'm checking out the sqlite and html5 using Javascript, heres the code I'm using to create, my DB, create my table and insert values from 3 text boxes that I have
function Add2DB()
{
var Tname = document.getElementById('txtName').value;
var Tprice = document.getElementById('txtPrice').value;
var Tqty = document.getElementById('txtQTY').value;
db.transaction(function (tx){
tx.executeSql('INSERT INTO foo (name,price,qty) VALUES(?,?,?)',[Tname,Tprice,qty]);
tx.executeSql('SELECT * FROM foo', [], function (tx, results){
var len = results.rows.length;
//For statements not allowed, just bring back first item in db
alert(results.rows.item(0).text)
});
});
}
The problem I'm having is that whenever I iterate through this, It just says Object object. I think it is a Javascript problem I'm having, I'm not certain though
tx.executeSql('INSERT INTO foo (name,price,qty) VALUES(?,?,?)',[Tname,Tprice,qty]);
This line might not be right either and may not be actually inserting the mapped values right. Can someone please shed some light on this. Any help, or ideas would help me greatly. Thank you.