hi ,
I want to store image data in mySQL database using rails.
I have created a table called “Photo_info” which have field called “photo_data” and the data type of that field is “varchar”.
My code is:
varchar is the wrong column type. It's almost certainly too short but
beyond that it's expecting text data, not arbitrary binary data. If
you want to store stuff like that in the database you should be using
a blob column (storing large files in the database isn't usually that
great of an idea though)