当我尝试在我的选择查询中放置通配符时,qt 给了我一个错误。我需要将变量与查询结果进行比较,但输入通配符似乎不起作用。请帮忙!
Text{
id: searchresults
text: ""
font.pixelSize: 45
color: "black"
opacity: 1
x: 10
function findHerb(value) {
var db = getDB();
db.transaction(
function(tx) {
var rec = tx.executeSql('SELECT name FROM Herbs WHERE name LIKE "?%"', [value]);
var r = "";
for(var i=0; i<rec.rows.length; i++) {
r+= rec.rows.item(i).name + "\n"
}
text = r;
}
)
}
}