Is there a way to store audio file into mysql? if yes! Can you show me how?
It's better to store audio files in dir on your server and put path in MySQL field.
yes! this is the right procedure to do!Originally Posted by insic_19
@docepares do you still practice docepares?
they all right bai. 1 reason that it didn't store and mysql didn't support of audio - huge file to retrieve and save.
But if your reason why you store it in database is security. Just try to look at other procedure or either just encode it.
I will give you other tip, if you want to.
Try to this php code. If you don't know yet to store your image in mysql database.
/**
* This is the database I used temporarily
* Test Database Structure
* ------------------------
* images CREATE TABLE `images` (
`id` int(4) unsigned NOT NULL auto_increment,
`image` longblob,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
*/
// Zend framework
require_once 'Zend/Db.php';
try
{
$db = Zend_Db::factory('Pdo_Mysql',
array('host' => 'localhost',
'username' => 'root',
'password' => '',
'dbname' => 'test'));
} catch(Exception $e) { print $e->getMessage(); }
// get the file
$file = file_get_contents('store.png');
$data = array(
'image' => $file
);
// Save your images
$db->insert('images', $data);
// Close DB
$db->closeConnection();
tnx
All right, Thanks a lot guys!
Similar Threads |
|