title: while uploading a image using php and mysql: Warning: file_get_contents(): Filename cannot be empty
body: <p>when i am trying to upload a image to photos folder i am having this type of warning msg i dont know what to.. 
  <strong>This is my php file</strong></p>
  
  <pre><code>if (!isset($_FILES['image']['tmp_name'])) {
      echo "";
      }else{
      $file=$_FILES['image']['tmp_name'];
      $image= mysql_real_escape_string(addslashes(file_get_contents($_FILES['image']['tmp_name'])));
      $image_name= addslashes($_FILES['image']['name']);
  
              move_uploaded_file($_FILES["image"]["tmp_name"],"photos/" . $_FILES["image"]["name"]);
  
              $location="photos/" . $_FILES["image"]["name"];
  
              $save=mysql_query("insert into add values('$location')") or die("can not insert");
              exit();                 
      }
  </code></pre>
  
  <p><strong>This is my html code</strong></p>
  
  <pre><code>&lt;form method="POST" action='ap.php' enctype="multipart/form-data"&gt;
  &lt;input name="image" id="image" type="file" /&gt;
  &lt;input type='submit' name='Add' value='Add'  /&gt;
  &lt;/form&gt;
  </code></pre>