Connecting Tech Pros Worldwide Forums | Help | Site Map

I'm just wondering if it is possible to save a video on mysql database?

Nert's Avatar
Member
 
Join Date: Nov 2006
Location: Philippines
Posts: 64
#1: Nov 16 '06
hi,

I've created a website, uhhmmn something like posting/uploading images and videos.., i made my site working well, i save images on database but the videos are just copied from the client folder to the folder on my server, the only thing i save is the url of the video so that i can able to display it using the <embed> tag. Now i'm just wondering if it is possible to save a video on mysql database? If it's not can anyone give me a suggestion on how can i have this video on my server asside from just copying them from the client folder to the folder on my server..?

I'll appreciate any seggestions you have guys.., thanks in advance..(^_^)


--nert

sashi's Avatar
Expert
 
Join Date: Jun 2006
Location: Seremban, Malaysia
Posts: 1,630
#2: Nov 19 '06

re: I'm just wondering if it is possible to save a video on mysql database?


Quote:

Originally Posted by Nert

hi,

I've created a website, uhhmmn something like posting/uploading images and videos.., i made my site working well, i save images on database but the videos are just copied from the client folder to the folder on my server, the only thing i save is the url of the video so that i can able to display it using the <embed> tag. Now i'm just wondering if it is possible to save a video on mysql database? If it's not can anyone give me a suggestion on how can i have this video on my server asside from just copying them from the client folder to the folder on my server..?

I'll appreciate any seggestions you have guys.., thanks in advance..(^_^)


--nert

Hi there,

Yeah, u can save video format files on MySQL database. It's done using Binary Large Object (BLOB) technique, kindly refer to below attached links, hope it helps. Good luck & Take care.

http://dev.mysql.com/doc/refman/4.1/...uirements.html
http://dev.mysql.com/tech-resources/...-handling.html
http://www.devarticles.com/c/a/MySQL/MySQL-and-BLOBs/
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#3: Nov 19 '06

re: I'm just wondering if it is possible to save a video on mysql database?


And don't forget Blobbing data with PHP and MySQL

Ronald :cool:
sashi's Avatar
Expert
 
Join Date: Jun 2006
Location: Seremban, Malaysia
Posts: 1,630
#4: Nov 20 '06

re: I'm just wondering if it is possible to save a video on mysql database?


Quote:

Originally Posted by ronverdonk

And don't forget Blobbing data with PHP and MySQL

Ronald :cool:

Hi Ronald,

Thanks for the additional info. Take care.
Nert's Avatar
Member
 
Join Date: Nov 2006
Location: Philippines
Posts: 64
#5: Nov 20 '06

re: I'm just wondering if it is possible to save a video on mysql database?


Hi,

Thanks for the reply, i'll study about that..(^_^)


--nert
Nert's Avatar
Member
 
Join Date: Nov 2006
Location: Philippines
Posts: 64
#6: Nov 22 '06

re: I'm just wondering if it is possible to save a video on mysql database?


hi,

i made the following code but, i still can't save videos on mysql database, is there something wrong with my code?

please help..

[PHP]

if(isset($_FILES['video'])) {
$content = fopen($_FILES['video']['tmp_name'], 'r');
$the_video = fread($content, filesize($_FILES['video']['tmp_name']));

$sql_insert = "INSERT INTO tbl_videos (uploaderid, video, date_uploaded, time_uploaded) VALUES ('$posterid', '$the_video', '$date_posted', '$time_posted')";
mysql_query($sql_insert) or die(mysql_error());
echo "The video has been saved and posted.";
}
[/PHP]


--nert
Reply