title: Inseting data in database over AJAX and JQuery
body: <p>Ok so I tried to do this in an easier way to break it into pieces and then to solve each piece but no luck. Can you help me I don't get any errors but just nothing happens. What I want is to insert data of admin in database over AJAX.PHP code works fine when it is without AJAX and I have no errors in console. </p>
  
  <p>This is my HTML : </p>
  
  <pre><code> &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;form  method="post" name="frmProduct" id="frmProduct" enctype="multipart/form-data"&gt;
      &lt;input id='username' type='text' value='username'/&gt; 
      &lt;input id='password' type='password' value='password'/&gt;                         
      &lt;input id="submit_value" type="button" name="submit_value" value=""&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my JQuery : </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  document.getElementById("submit_value").onclick = submitAction;
  
  function submitAction()
  {
      var username = $('#username').val();
      var password = $('#password').val();
      console.log(username);
      console.log(password);
  
      $.ajax({
              type: "POST",
              url:  "insertAdmin.php",
              data: "username="+ username + "&amp;password="+ password,
              success: function(){
                  $("#frmProduct").fadeOut();
                  $("#frmProduct").fadeIn();
              }
          });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is my php : </p>
  
  <pre><code>&lt;?php 
  
  error_reporting(E_ALL ^ E_DEPRECATED);
  
  $con = mysql_connect("localhost","root");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("bazait", $con);
  
  $sql="INSERT INTO administrators ( namea, passa) VALUES ('$_POST[username]','$_POST[password]')";
  
  if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
  echo "Successfully sent Email address.";
  
  mysql_close($con); 
  }
  ?&gt;
  </code></pre>