-
December 28th, 2016, 11:21 PM
#1
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
-
January 7th, 2017, 12:51 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|