
Originally Posted by
C167
If you pass a string to QSqlQuery constructor, it will execute it immediately. It should be:
query.prepare("UPDATE pictures SET data=? WHERE rowid=1;");
query.addBindValue(fileData);
query.exec();
QSqlQuery query;
query.prepare("UPDATE pictures SET data=? WHERE rowid=1;");
query.addBindValue(fileData);
query.exec();
To copy to clipboard, switch view to plain text mode
And the select should be:
QSqlQuery query
( "SELECT data FROM pictures WHERE rowid=1;" );
query.next(); // <- positions the query on the first row
QSqlQuery query( "SELECT data FROM pictures WHERE rowid=1;" );
query.next(); // <- positions the query on the first row
QSqlRecord record = query.record();
To copy to clipboard, switch view to plain text mode
Bookmarks