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/

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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