title: uploading videos into a folder and its link to database using PHP/MySQL
body: <p>I am trying to upload a video and save it in a folder as well as savings its path in the database, but the videos are not inserting into the specific folder.</p>
  
  <p>I have searched a lot and found some code. The code is working for images. I have done some modifications from images to videos, but that didn't work.</p>
  
  <p>Here is the parts of my code.</p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt;
  &lt;div class="form_search"&gt;
  &lt;label&gt;Upload Video Profile:&lt;/label&gt;
  &lt;span class="form_input"&gt;
  &lt;input type="file" name="uploadvideo"  /&gt;
  &lt;/span&gt;
  &lt;/div&gt;
  
  &lt;div class="form_search"&gt;
  &lt;label&gt; &amp;nbsp;&lt;/label&gt;
  &lt;span class="form_input"&gt;
  &lt;input type="submit" name="submitdetails" value="Upload" class="button"/&gt;
  &lt;/span&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and my php code to upload video is</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submitdetails']))
  {
  $name=$_FILES['uploadvideo']['name'];
  $type=$_FILES['uploadvideo']['type'];
  //$size=$_FILES['uploadvideo']['size'];
  $cname=str_replace(" ","_",$name);
  $tmp_name=$_FILES['uploadvideo']['tmp_name'];
  $target_path="company_profile/";
  $target_path=$target_path.basename($cname);
  if(move_uploaded_file($_FILES['uploadvideo']['tmp_name'],$target_path))
  {
      echo "hi";
  echo $sql="UPDATE employer_logindetails SET (video) VALUES('".$cname."')"; 
  $result=mysql_query($sql);
  echo "Your video ".$cname." has been successfully uploaded";
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>Please help me where I am going wrong.</p>
  
  <p>All my <code>php.ini</code> modifications are done, and video size is only 7mb.</p>