title: Insert picture into database using php
body: <p>hello i have a form with many input ( name, last name, picture,age..) and i want to submit all this information into my database , i know how to do it for a simple input but with the picture i have some problem 
  can someone help me please
  my html file is </p>
  
  <pre><code>&lt;form action="insertion.php" method="post" &gt;
  &lt;table &gt;
   &lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Titre&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input name="titre" type="text" value=""  /&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Annee&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input name="annee" type="number" value=""  /&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Genre musical&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input name="Gmusical" type="texte" value="" /&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;
   &lt;strong&gt;Picture&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
   &lt;input type="file" name="img"/&gt;
   &lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
   &lt;input type="submit" value="Submit "  /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>my file insertion.php to sublmit into the database is </p>
  
  <pre><code>&lt;?php
  include("connexion.php");
  $titre=$_POST['titre'];
  $annee=$_POST['annee'];
  $Gmusical=$_POST['Gmusical'];
  $picture=$_POST['img'];
  
  $req="INSERT INTO `cd`
  (`titre`, `Annee`, `genremusical`, `Image`) 
  VALUES 
   ('$titre','$annee','$Gmusical','$picture');";
  
              if (mysql_query($req))
              {
              echo "ok";
              }
              else 
              echo 'ko';
              }
  </code></pre>