Jump to content

Adding Videos to Mysql


veluit06

Recommended Posts

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/

 

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..

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.