title: post a pic in a database in php
body: <p>I am trying to test how to upload a pic on my wamp database but I have a of "Undefined index:Pic" error. Could you please help me? Thank you!</p>
  
  <p>Here is the code of my formulaire:</p>
  
  <pre><code>  &lt;form action="PicPost.php" method="post" enctype="multipart/form-data"&gt;
    &lt;p&gt;
     Formulaire d'envoi de fichier :&lt;br /&gt;
     &lt;input type="file" name="Pic" /&gt;&lt;br /&gt;
     &lt;input type="submit" value="Post the pic" /&gt;
      &lt;/p&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>And here is the file that should treat it:</p>
  
  <pre><code>    &lt;?php
      try
      {
      $bdd = new PDO('mysql:host=localhost;dbname=db', 'root', '');
      }
      catch (Exception $e)
      {
  die('Erreur : ' . $e-&gt;getMessage());
      }
      $req = $bdd-&gt;prepare('INSERT INTO picdb (Picture)
      VALUES(?)');
      $req-&gt;execute(array($_POST['Pic']));
      ?&gt;
  </code></pre>