Hello I would like to know how do I store audio files in a database so I can retrieve them.
The problem starts when I try to save the audio file. Right now I am using phpMyAdmin and manually inserting the data(which I intend to change later).
The problem occurs when I hit BROWSE and then OPEN. It just loops and loops and then I get this error. "#2006 - MySQL server has gone away"
So far this is my structure:
Table structure for table `music`
--
CREATE TABLE IF NOT EXISTS `music` (
`music_id` tinyint(4) NOT NULL AUTO_INCREMENT,
`music_title` varchar(200) DEFAULT NULL,
`music_file` mediumblob,
`music_catagory` varchar(50) DEFAULT NULL,
PRIMARY KEY (`music_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
and this is the code I am using to retrieve it.
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
// 6a. Get the values with the new Array() $row[].
// Put the name of the field you want between the [] for $row.
echo "<br>ID: " . $row["music_id"];
echo "<br>Title: " . $row["music_title"];
echo "<br>Music Link: " . $row["music_file"];
echo "<br> Catagory: " . $row["music_catagory"];
echo "<br />";
echo "<br />";
}
If you can send me to a tutorial or help on how to save audio files and then retrieve them that would be very helpful.
Thanks In advance