Solved

which data type for audio in mysql

Posted on 2013-12-20
4
1,367 Views
Last Modified: 2013-12-20
what data type do i use in mysql if i want to store audio files in the database????
0
Comment
Question by:selhamwy
  • 3
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39733228
It would be binary blob http://dev.mysql.com/doc/refman/5.5/en/blob.html .  But it's generally not a good idea.  You usually have to extract media data back to files so the players will know what to do with them.  The usual recommendation is to store the audio files in the file system and the file names and paths in the database.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39733229
Note that blobs are stored outside the database as files.  So to use a blob for an audio file, you would have to read it from the database, write it to a file with the right extension, and then let the player read the file to play.  That's a lot of disk activity compared to reading the file name and passing it to the player.
0
 

Author Closing Comment

by:selhamwy
ID: 39733266
that is the best alternative thanks for pointing it out...
it is late and i am not thinking straight
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39733269
Thanks for the points.  Get some rest, things will work out better.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Where can I find... 1 34
How to change the link of an image using md5 in php ? 3 32
How do I fix this UPDATE error? 7 24
QQ problem 22 23
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 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