samedi 31 janvier 2015

How to get last created id from sqlite data base using javascript?



$('#CreateCustomer').submit(function () {
if ($('#CreateCustomer').parsley('validate')) {

var name = $('#pname').val();
var city = $('#pcity').val();
var address = $('#paddress').val();
var mail = $('#pmail').val();
var phone1 = $('#pphone1').val();
var phone2 = $('#pphone2').val();
db.transaction(function (tx) {
tx.executeSql(InsertPerson, [name, mail, city, address, phone1, phone2], onError);
});
}
ResetForm();
$('#close').click();
location.href = "view.html?id=" + id;
return false;




Aucun commentaire:

Enregistrer un commentaire