Qt 6.11 is out! See what's new in the release
blog
Load Image From Db Problem
-
yep, you should check QSqlQuery::bindValue
sql.prepare("UPDATE Patient_File SET SskeletonPic= :skp WHERE SmeliCode= :smc"); sql.bindValue(":skp",inByteArraye); sql.bindValue(":smc",seMcode); sql.exec();this also prevents SQL Injection. You should never really use unescaped input directly to build the query string
-
yep, you should check QSqlQuery::bindValue
sql.prepare("UPDATE Patient_File SET SskeletonPic= :skp WHERE SmeliCode= :smc"); sql.bindValue(":skp",inByteArraye); sql.bindValue(":smc",seMcode); sql.exec();this also prevents SQL Injection. You should never really use unescaped input directly to build the query string
-
Summary of the above:
- in the database use the type
VABBINARYnotIMAGE - use QSqlQuery::bindValue instead of string concatenation to build your query
- in the database use the type