Lines 1-10: you should be using the native MySQL driver, so I guess you didn't manage to build that. This will do but isn't ideal.
Lines 16-17: Why construct a null pixmap only to replace it immediately on the next line?
Line 20-29: If you don't want the data in a file on disk why save it to a file?
Line 21:Line 26: Are you sure the file opened successfully? You don't bother to check.Originally Posted by Qt Docs
Line 27: Unnecessary as this is the default position in a newly opened file.
Line 29: Fails to give you the whole file if the file is large than 250000 bytes.
Line 32: This is not valid SQL as was pointed out the last time you asked. You said you tried the corrected version provided... I guess you didn't bother. Get into the habit of checking return codes. QSqlQuery::prepare() returns false on failure. When it does so QSqlQuery::lastError() is useful. Get into the habit of using the error message the system provides.
Line 34: I guess you didn't want to execute the query you prepared at 32Shame really because it is close to working.
Lines 37-44: Building queries like this is clumsy, error prone, dangerous and, in the case of binary data, not useful. Go back to line 32.
Line 49: Have you checked "done"?
Bookmarks