Solved

What format or data type are images stored in MySQL tables

Posted on 2013-06-28
5
428 Views
Last Modified: 2013-06-28
HI Experts

Can anyone tell me how to convert a jpeg image into some sort of text, that I can then copy and paste into an "SQL insert" or MySQL insert using the GUI?

The reason for this question, is I'd rather use some sort of application to do this, and was hoping there might be an online one to do this.

Any help/direction on either of these questions would be much aprectiated

Thanks
0
Comment
Question by:georgehowell
5 Comments
 
LVL 5

Expert Comment

by:sriramiyer
ID: 39284593
I believe it is not a wise idea to convert image to text and store it in a MySQL record.  pl. think over is it absolutely needed to do like that?
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 250 total points
ID: 39284832
Storing image in a database is a really, really, REALLY BAD IDEA.  However if you want to go that route then you will need to use a blob data type, and pre-process with PHP.  

This outlines how to do it, and points out why it is a bad idea:

http://www.phpriot.com/articles/images-in-mysql
Cd&
0
 

Author Comment

by:georgehowell
ID: 39284923
thanks Cobol for the link.. I'm reading it right now

there's only 6 product thumbnails on the whole site, so it's minimal data.  

Does anyone know if there's any online conversion or downloads to change a jpg to "blob" data-type ?

cheers
0
 
LVL 23

Accepted Solution

by:
nemws1 earned 250 total points
ID: 39284924
I agree with the other comments posted, BTW.

The thing that comes to mind first when reading this is to MIME encode the image and store the result.  It will be all "plain text" (no binary data).  Of course, you need to MIME *de*-code the image once you yank it out of the database.  All this is highly inefficient and will slow down whatever process it is you're trying to do.
0
 

Author Comment

by:georgehowell
ID: 39285001
thanks gents for your help
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now