title: importing csv using Ajax and PHP import csv to mysql, not uploading a file
body: <p>I have followin pages</p>
  
  <ul>
  <li>index.php</li>
  <li>importdata.php</li>
  </ul>
  
  <p>Im trying to use ajax importing a csv file into MySql
  I used dsome exapmples on the net but still wont work
  index.php</p>
  
  <p>the Script file in the beginning:</p>
  
  <pre><code>$(document).ready(function(){
  
      $("#but_import").click(function() {
          var formData = new FormData($("#import_form"));     
              $.ajax({
                  url:"importData.php",
                  data:formData,
                  type:'POST',
                  success:function(response) 
                  {
                      var resp = $.trim(response);
                      $("#output").html(resp);
                  }else[
  
                      $("#output").html("Error");
  
                  });
  
      });
     }); 
  </code></pre>
  
  <p>The HTML after the script:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Import CSV file data to the MySQL using PHP&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
   &lt;form id="import_form" method="post" action="" enctype="multipart/form-data" &gt;
          &lt;table width="100%"&gt;
  
              &lt;tr&gt;
                  &lt;td style="width: 58px"&gt;
                      &lt;input type='file' name="score_file" id="score_file"&gt;
                  &lt;/td&gt;
  
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td colspan="2" &gt;
                  &lt;input type="button" id="but_import" name="but_import" value="Import File"&gt;&lt;/td&gt;
              &lt;/tr&gt;
  
          &lt;/table&gt;
      &lt;/form&gt;
  
  
  &lt;table style="width: 100%"&gt;
      &lt;tr&gt;
          &lt;td id="output"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>