I also noticed that I can use "bindValue()" for select statements, even though the examples only show them for inserts:
query.prepare("select userid, username, firstname, lastname, email, status from user where username=:username");
query.bindValue(":username", login.username);
if (!query.exec()) {
//do something to handle the error here
} else {
while (query.next()) {
//do something with the results we got here
}
}
]
query.prepare("select userid, username, firstname, lastname, email, status from user where username=:username");
query.bindValue(":username", login.username);
if (!query.exec()) {
//do something to handle the error here
} else {
while (query.next()) {
//do something with the results we got here
}
}
]
To copy to clipboard, switch view to plain text mode
is this a proper use of "bindValue()"?
Bookmarks