veluit06 Posted June 17, 2009 Share Posted June 17, 2009 Hi anyone tel me the procedure upload a videos and store that video in Mysql inside the table field, this and all using php and Mysql, can u tel me the procedure and sample examples..... Quote Link to comment https://forums.phpfreaks.com/topic/162513-adding-videos-to-mysql/ Share on other sites More sharing options...
MadTechie Posted June 17, 2009 Share Posted June 17, 2009 Sure.. however I hope your aware this will use up a lot of space in the tables and generally I wouldn't recommend it (but theirs always exceptions) Basically you want to store the data in a blob, ie $data = readfile("myFile.mov"); $SQL = "INSERT into table Set myBLOB = $data"; this article is a little out dated but should at least show you the whole idea http://www.devarticles.com/c/a/MySQL/Blobbing-Data-With-PHP-and-MySQL/ Quote Link to comment https://forums.phpfreaks.com/topic/162513-adding-videos-to-mysql/#findComment-858528 Share on other sites More sharing options...
veluit06 Posted June 18, 2009 Author Share Posted June 18, 2009 thanks for this code. after storing this video, i want to display that video in mentioned page, what is procedure for that, Quote Link to comment https://forums.phpfreaks.com/topic/162513-adding-videos-to-mysql/#findComment-858821 Share on other sites More sharing options...
MadTechie Posted June 18, 2009 Share Posted June 18, 2009 Okay create a file for displaying the videos ie video.php Now your going to pass the ID for the video you wish to play Now playing a video will be the same as linking to the file directly but instead of doing src="myvideo.mpg" you will use src="video.php?ID=99" Now the video.php file does a query to find the correct video record (ie WHERE ID = {$_GET[iD]}) and echos the blob, and thats it.. Quote Link to comment https://forums.phpfreaks.com/topic/162513-adding-videos-to-mysql/#findComment-858937 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.