[Qt-interest] Mysql how to update a blob field
Stephen Collyer
scollyer at netspinner.co.uk
Wed May 19 12:57:06 CEST 2010
On 19 May 2010 08:50, David Boosalis <david.boosalis at gmail.com> wrote:
> A while ago I asked on this users group how to update a blob with SQLite,
> and I got a good answer. Now I have a similiar question for doing it with
> Mysql.
>
> Here is what I have been trying to use (which is what works with SQLite)
>
> QString str= "update filter set"
> + QString(" style=:style")
> QString(" WHERE id=" + QString::number(id));
> // style = blob field in mysql table
> bool bstatus = query.prepare(str);
>
>
Presumably you're doing query.bindValue(..) at some point ?
I would expect this to work fine with MySQL. I have had no
problem with this myself.
One other question: why aren't you binding id too ? It looks
somewhat inconsistent at the moment.
What does query.lastError() say ?
--
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100519/98a49402/attachment.html
More information about the Qt-interest-old
mailing list