Can anyone please give me a sample how to insert image to MySQL and retreiving it.
Printable View
Can anyone please give me a sample how to insert image to MySQL and retreiving it.
What did Google said?
have you also post this in Database forum?
actually i'm not 100% pos but you cant actually store an image in a database, but you can store the name of it.
I.E.
Insert into X VALUES("myimage.jpg");
Just a suggestion... im not sure if this is possible....
What if you will encode the image data in your own pattern...
eg. weird characters change to readable characters....
And store the encoded data in the database...
Maybe if implemented, you will expect more comparisons...
1 for encoder, also 1 for decoder....
the problem with encoding data to place into a database is selecting the right column datatype. Now it would be entirly possible to store an encrypted item in a database as long as you set it to nvarchar[MAX].
that makes it inefficiant though. Its better to store the image filename and just retrieve it.
In simple word convert the image into binaries and store it in a database as a image(image data type)
hrm interesting. Didn't know that there was an image data type.
You can store images into DB by converting images into byte streams.
Yes pal you can do it easily... just convert the image into ByteStream and then using BLOB data type in db you can store it into db.
please check the thread....
Check It
Ah, got it. I remember work with BLOB at my C++ project. Thanks Sanjeev. And also thanks for the link.