나는 어떻게 든 다음 코드와 함께 텍스트 필드 id를 사용하여 텍스트 필드의 내용을 삽입 할 수 있었지만 텍스트 필드의 내용을 변수에 할당 한 다음 해당 변수의 값을 삽입했습니다.SQLite에서 데이터베이스에 변수 값을 삽입하려면 어떻게해야합니까?
var newName = document.getElementById("txNewName").value;
var ing1 = document.getElementById("txIngredient1").value;
var ing2 = document.getElementById("txIngredient2").value;
var ing3 = document.getElementById("txIngredient3").value;
db.transaction(function(transaction) {
transaction.executeSql('INSERT INTO MyRecipes(MyRecipeName, MyIngredient1, MyIngredient2, MyIngredient3) VALUES (?,?,?,?)',[$('#txNewName').val(), $('#txIngredient1').val(), $('#txIngredient2').val(), $('#txIngredient3').val()]);
});
차이점이 있으며 매우 새로운 점이 있다면 어떤 도움을 주시면 SQLite를 사용하고 있습니다.
를 제외하고, 당신은 자바 스크립트와 jQuery를 믹싱 - 더 나은 JQuery와 구문 당신이 그것을 사용하는 경우에 충실. – Turophile