Hi all,
I am trying to insert a PNG image into a mysql database using Qt.
I am facing the problem to escape special characters into image and
I cannot find any function in Qt related to this.
I am attaching the piece of my code for this.
image->save(&buffer, "PNG"); //image is a QImage
QString sql
= QString( "INSERT INTO myTable ( blob ) VALUES ( %1 )").
arg( ba.
data() )
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image->save(&buffer, "PNG"); //image is a QImage
QString sql = QString( "INSERT INTO myTable ( blob ) VALUES ( %1 )").arg( ba.data() )
To copy to clipboard, switch view to plain text mode
and when exec() this sql query, I get an error. Most probably I need to escape `ba.data()'
plz help
Bookmarks