Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What format or data type are images stored in MySQL tables

Posted on 2013-06-28
5
432 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

828 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