title: My image isn't dowloading to my db table
body: <p>I have this code in Php to upload images, the thing is that when i insert a picture it will properly get saved in the folder prueba/, but it won't get uploaded to my db_table.</p>
  
  <pre><code>if(isset($_POST['btn-add']))
      {
          $name=$_POST['user_name'];
  
          $images=$_FILES['profile']['name'];
          $tmp_dir=$_FILES['profile']['tmp_name'];
          $imageSize=$_FILES['profile']['size'];
  
          $upload_dir='prueba/';
          $imgExt=strtolower(pathinfo($images,PATHINFO_EXTENSION));
          $valid_extensions=array('jpeg', 'jpg', 'png', 'gif', 'pdf');
          $picProfile=rand(1000, 1000000).".".$imgExt;
          move_uploaded_file($tmp_dir, $upload_dir.$picProfile);
          $stmt=$db_conn-&gt;prepare('INSERT INTO restaurantes_resutlado (name, fotos) VALUES (:uname, :upic)');
          $stmt-&gt;bindParam(':uname', $name);
          $stmt-&gt;bindParam(':upic', $picProfile);
          if($stmt-&gt;execute())
          {
              ?&gt;
              &lt;script&gt;
                  alert("new record successul");
                  window.location.href=('index.php');
              &lt;/script&gt;
          &lt;?php
          }else 
  
          {
              ?&gt;
              &lt;script&gt;
                  alert("Error");
                  window.location.href=('index.php');
              &lt;/script&gt;
          &lt;?php
          }
  
      }
  </code></pre>
  
  <p>db:</p>
  
  <pre>
  Name Type Collation Attributes Null Default Comments Extra
  1 id int(11) No None
  2 nombre varchar(150) latin1_swedish_ci No None
  3 zona varchar(150) latin1_swedish_ci No None
  4 precio float No None
  5 valoracion float No None
  6 comentarios varchar(100) latin1_swedish_ci No None
  7 ranking int(1) No None
  8 tipo_cocina varchar(100) latin1_swedish_ci No None
  9 horario time No None
  10 fotos varchar(200) latin1_swedish_ci No None
  </pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="container"&gt;
          &lt;div class="add-form"&gt;
              &lt;h1 class="text-center"&gt;Please Insert new Item image&lt;/h1&gt;
              &lt;form method="post" enctype="multipart/form-data"&gt;
                  &lt;label&gt;User Name&lt;/label&gt;
                  &lt;input type="text" name="user_name" class="form-control" required=""&gt;
                  &lt;label&gt;Picture Profile&lt;/label&gt;
                  &lt;input type="file" name="profile" class="form-control" required="" accept="*/image"&gt;
                  &lt;button type="submit" name="btn-add"&gt;Add New &lt;/button&gt;
  
              &lt;/form&gt;
          &lt;/div&gt;
          &lt;hr style="border-top: 2px red solid;"&gt;
      &lt;/div&gt;  
  &lt;!-- end form insert --&gt;
  &lt;!-- view form --&gt;
  &lt;div class="container"&gt;
      &lt;div class="view-form"&gt;
          &lt;div class="row"&gt;
          &lt;?php 
              $stmt=$db_conn-&gt;prepare('SELECT * FROM tbl_user ORDER BY id DESC');
                  $stmt-&gt;execute();
                  if($stmt-&gt;rowCount()&gt;0)
                  {
                      while($row=$stmt-&gt;fetch(PDO::FETCH_ASSOC))
                      {
                          extract($row);
                          ?&gt;
              &lt;div class="col-sm-3"&gt;
              &lt;p&gt;&lt;?php echo $username ?&gt;&lt;/p&gt;
              &lt;img src="uploads/&lt;?php echo $row['picProfile']?&gt;"&gt;&lt;br&gt;&lt;br&gt;
  
              &lt;a class="btn btn-info" href="edit_form.php?edit_id=&lt;?php echo $row['id']?&gt;" title="click for edit" onlick="return confirm('Sure to edit this record')"&gt;&lt;span class="glyphicon glyphicone-edit"&gt;&lt;/span&gt;Edit&lt;/a&gt;
              &lt;a class="btn btn-danger" href="?delete_id=&lt;?php echo $row['id']?&gt;" title="click for delete" onclick="return confirm('Sure to delete this record?')"&gt;Delete&lt;/a&gt;
  
              &lt;/div&gt;
  
              &lt;?php 
  
                  }
              }
              ?&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Connection:</p>
  
  <pre><code>&lt;?php
  // Database configuration
  $dbHost     = "localhost";
  $dbUsername = "root";
  $dbPassword = "root";
  $dbName     = "restaurantes";
  
  // Create database connection
  $db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);
  
  // Check connection
  if ($db-&gt;connect_error) {
      die("Connection failed: " . $db-&gt;connect_error);
  }
  ?&gt;
  </code></pre>