Bug #1386 IMAGE data type
Submitted: 23 Sep 2003 19:27 Modified: 24 Sep 2003 11:50
Reporter: Daniel Brown Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: User-defined functions ( UDF ) Severity:S4 (Feature request)
Version: OS:
Assigned to: CPU Architecture:Any

[23 Sep 2003 19:27] Daniel Brown
with mysql 5.0 or even 41. would it be possible to maybe have a IMAGE type for records, im currently devleoping a application which needs to store images in a fields ( yes yes i know but they want it like that), but the image contains things liek \t \n \r which as wel all know are text controls \t (tab) \n ( new line) etc and thus the image is curupted. So a IMAGE data type would be a nice feature to add. 


How to repeat:
[23 Sep 2003 19:46] Paul DuBois
You don't need an IMAGE type to accomplish
what you want. Use a BLOB column rather than
a TEXT column to store binary data such as
images. The only thing you need to make
sure of is that you properly escape your
data before inserting it. (For example,
by using mysql_real_escape_string() if you're
using C.)
[23 Sep 2003 23:16] Daniel Brown

must admit i was supprised that someone responsed :) thanks.

anywho back to business, im using the blob field, the binairy data im uploading is just a jpg file, nothing flash, however when trying to putt it out of the database it screws up, becuase there is \n ,\t \0 in there, etc, and mysql pulsl a blob out as a string, hence my problem, inserting  can do i just do load_file, but pulling it out is a hole different story.

im currently using C# / VS.NET 2003 to develop in ( creating a website ), so no real way for me to access the mysql C api, just basicly the myodbc, etc which i havvnt had much experiance in.

thanks again :)


[24 Sep 2003 11:50] Lenz Grimmer
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem is not the result of a bug.
For a list of more appropriate places to ask for help using MySQL
products, please visit http://www.mysql.com/support/

Thank you for your interest in MySQL.

As this is not a bug in MySQL, I will close this report.
I found the following two articles that might be helpful for you:

"Accessing MySQL BLOB columns using Visual Basic 6"

"How to store images directly in the sql database"