우리는이 같은 특정 행 요청할 수 배열에서 행을 얻을 수있는 선택 사용 websql :는 websql에서
tx.executeSql('SELECT * FROM tblSettings where id = ?', [id], function(tx, rs){
// do stuff with the resultset.
},
function errorHandler(tx, e){
// do something upon error.
console.warn('SQL Error: ', e);
});
그러나, 내가 아는 일반 SQL을하고 난 요청할 수 있어야한다 생각
var arr = [1, 2, 3];
tx.executeSql('SELECT * FROM tblSettings where id in (?)', [arr], function(tx, rs){
// do stuff with the resultset.
},
function errorHandler(tx, e){
// do something upon error.
console.warn('SQL Error: ', e);
});
하지만 결과가 없으면 결과는 항상 비어 있습니다. arr
에 [arr]
을 제거하면 sql은 다양한 양의 매개 변수를 가져 오므로 [arr]
이어야합니다. 그렇지 않으면 물음표의 역동적 인 양을 추가해야합니다 (배열에 ID가있는만큼).
아무도 내가 잘못하고있는 것을 볼 수 있습니까?