CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Location
    India
    Posts
    333

    MySQL BLOB Using C++ & Linux

    Hi,

    Using Ubuntu, I like to create a database with image saving option. First i was create MySQL database outside and retrive the image file from that.
    Code:
    mysql> CREATE TABLE picture(id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, img TINYBLOB NOT NULL, PRIMARY KEY(id));
    Query OK, 0 rows affected (0.22 sec)
    
    mysql> INSERT INTO picture (img) VALUES(LOAD_FILE('/home/mate/Desktop/1.jpg'));
    ERROR 1048 (23000): Column 'img' cannot be null
    
    mysql> INSERT INTO picture (img) VALUES('/home/mate/Desktop/1.jpg');
    Query OK, 1 row affected (0.03 sec)
    
    mysql> select * from picture;
    +----+--------------------------+
    | id | img                      |
    +----+--------------------------+
    |  1 | /home/mate/Desktop/1.jpg |
    +----+--------------------------+
    1 row in set (0.00 sec)
    Am i right?

    How to retrieve,insert,delete the image using c++ code.
    Regards,

    SaraswathiSrinath

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: MySQL BLOB Using C++ & Linux

    Go to the mySql site and download the c++ examples.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured