in reply to Re^3: DBD::SQLite, how to pass array in query via placeholder?
in thread DBD::SQLite, how to pass array in query via placeholder?
function showRecords2() { var firstName2 = document.getElementById('f +irstName22').value; results4.innerHTML = ''; db.transaction(function(tx4) { //tx.executeSql(selectAllStatement2, [], function(tx, result +) { //var firstName2 = document.getElementById('firstName22'); //tx.executeSql('SELECT * FROM Strokes WHERE email = ?', [ema +il], renderResults); // tx4.executeSql('SELECT * FROM Contacts WHERE firstNam +e="Joo" ', [], function(tx4, result4) { tx4.executeSql('SELECT * FROM Contacts WHERE firstName="' + +firstName2 + '" ', [], function(tx4, result4) { dataset = result4.rows; // report(result.rows[0].firstName, result.rows[0].lastName) +; for (var i = 0, item = null; i < dataset.length; i++) { item = dataset.item(i); results4.innerHTML +='<table width="320" border="7"><tr +> <td style="font-size:18px" width="90">' + item['id'] + '</td>' ++ '<td width="30" style="font-size:17px">' + item['lastName'] + '</td +>' + '<td>' + '<a href="#" onclick="loadRecord('+i+')">Edit -- </a +> ' + '</td>' + '<td>' + '<a href="#" onclick="deleteRecord('+it +em['id']+')">Delete</a></td></tr></table>'; //results.innerHTML += // '<li>' + item['lastName'] + ' , ' + item['firstNam +e'] + ', ' + item['phone'] + '----------- <a href="#" onclick="loadRe +cord('+i+')">edit</a></li>'; } }); });
|
|---|