title: How to insert video in databaes and fetch on page using PHP and MySQL
body: <p>This is my code for <code>uploading video</code> on database or move to folder.
  In this code  video uploaded but not insert file into database....?? </p>
  
  <p>please help me how to insert video in database using PHP + MySQL ?   </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
   &lt;body&gt;
    &lt;form ACTION="test.php" method="post" enctype="multipart/form-data"&gt;
    &lt;label for="file"&gt;Filename:&lt;/label&gt;&lt;br&gt;
     &lt;input type="file" name="video"&gt;&lt;br&gt;
     &lt;input type="submit" name="submit" value="Submit"&gt;
     &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
    &lt;?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' &amp;&amp; $type !='MP4' &amp;&amp; $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 &lt;br/&gt; &lt;br/&gt;";
          }
         ?&gt;
  </code></pre>