Results 1 to 7 of 7

Thread: Read image and save to database?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Read image and save to database?

    You are good in researching others work flow.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Read image and save to database?

    ... and you, Sir, are very good at ignoring all advice and continuing to ask the same question yet again (resurrecting a two year old thread for no reason) with no evidence of any effort on your part to take on advice already offered.

    Here is the summary:
    • Stop using obsolete, deprecated or unsafe methods, e.g. QString::sprintf(), when better alternatives exist
    • Use QBuffer and QByteArray to save an image to an in-memory buffer (no temporary disk file).
    • Learn some basic SQL. If you cannot construct a basic SQL query outside Qt/C++ then you will not have any luck with QSqlQuery.
    • Use QSqlQuery::prepare() and QSqlQuery::bindValue() to insert blob's. In fact, you should use this anywhere you are tempted to build a query from many parts into a string.
    • You need to build and use the MySQL native driver to access your database directly rather than through ODBC.
    Last edited by ChrisW67; 22nd July 2011 at 00:40.

  3. The following user says thank you to ChrisW67 for this useful post:

    Gokulnathvc (22nd July 2011)

Similar Threads

  1. how to save a image file ( say png ) into mysql database?
    By AviMittal in forum Qt Programming
    Replies: 12
    Last Post: 21st July 2011, 12:49
  2. how to save database
    By khalid_se in forum Newbie
    Replies: 7
    Last Post: 10th July 2011, 18:47
  3. How to save the QColor and then read it?
    By ding in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2011, 10:55
  4. read files and save the,
    By kernel_panic in forum Qt Programming
    Replies: 2
    Last Post: 4th January 2007, 06:31
  5. Save images to database
    By jnk5y in forum Qt Programming
    Replies: 4
    Last Post: 8th May 2006, 19:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.