This is my code for uploading video
on database or move to folder.
In this code video uploaded but not insert file into database....??
please help me how to insert video in database using PHP + MySQL ?
<html>
<head>
</head>
<body>
<form ACTION="test.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label><br>
<input type="file" name="video"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
<?php
if(isset($_FILES['video']))
{
$name = $_FILES['video']['name'];
$type = explode('.',$name);
$type = end($type);
$size= $_FILES['video']['size'];
$random_name = rand();
$tmp= $_FILES['video']['tmp_name'];
if($type !='mp4' && $type !='MP4' && $type !='flv')
{
$message ="Video Format Not Supported";
}
else
{
move_uploaded_file($tmp, 'videos/'.$random_name.'.'.$type);
mysql_query("INSERT INTO 'videos' VALUES ('', '$name',
'videos/$random_name.$type')");
$message ="Successfully Uploaded";
}
echo "$message <br/> <br/>";
}
?>