title: Upload Image to database using Jquery ajax and PHP
body: <p>Hello guys hope you can help me with this, becuase i have no idea... I want to upload an image into a database table i just need to upload the image, and some other data, right now i save all the info in the data base using the following Code:</p>
  
  <pre><code> $.ajax({
        url: 'AccionesPHP.php',
        type: 'POST',
        data: {funcion:'SaveFamily',name:nam,lastn:ape,pasp:pas,dateb:dob,pased:ped,type:typ}
      })
  
      .done(function(datos)
      {
        if(datos==1)
        {
          alert('success');
        }
      });
  </code></pre>
  
  <p>and in the PHP side i have the following code:</p>
  
  <pre><code>case 'SaveFamily':
          $nom = $_POST['name'];
          $lastname = $_POST['lastn'];
          $pasp = $_POST['pasp'];
          $dateob = $_POST['dateb'];
          $pexpd = $_POST['pased'];
          $type = $_POST['type'];
          $query= mysqli_query($link,"INSERT INTO ticketdatarecep VALUES(NULL,".$_SESSION['id_users'].", '$nom', '$lastname', '$pasp', '$dateob', '$pexpd', '$type')");
          if($query == true)
          {
              echo "1";
          }
          else
          {
              echo mysql_error();
          }
  </code></pre>
  
  <p>so i have no form in my HTML and i want to add an input so user can uoload an image and save it in the same table and everything, bu i have no clue how to do it, all i have seen use FORM to send the data but still dont know how to send the image using $.ajax and how to catch the image data in my PHP code.</p>
  
  <p>Hope you can give me some ideas.</p>