title: Inserted data was not saving in phpmyadmin database
body: <p>i am new to php. I am trying to do login and registration in php mysql. for that i create one simple form and tested whethet the data was inserted in phpmyadmin or not. The values are not saving in db. I dont know where is the error. 
  I have include the coding below</p>
  
  <p>MY Db connection:</p>
  
  <pre><code>&lt;?php
  
    $connect = mysql_connect("localhost", "root", "") or die("Unable to connect database".mysql_error());
  
    mysql_select_db("logindb", $connect) or die ("sorry db connection fail");
  ?&gt;
  </code></pre>
  
  <p>My Registratiion form:</p>
  
  <pre><code>&lt;?php
  include("config.php");
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Login screen&lt;/title&gt;
      &lt;style type="text/css"&gt;
      .register-form{
          width: 500px;
          margin: 0 auto;
          text-align: center;
          padding: 10px;
          padding: 10px;
          background : #c4c4c4;
          border-radius: 10px;
          -webkit-border-radius:10px;
          -moz-border-radius:10px;
      }
      .register-form form input{padding: 5px;}
      .register-form .btn{
          background: #726E6E;
          padding: 7px;
          border-radius: 5px;
          text-decoration: none;
          width: 50px;
          display: inline-block;
          color: #FFF;
      }
      .register-form .register{
          border: 0;
          width: 60px;
          padding: 8px;
      }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  if(isset($_POST['submit']))
  {
  $name=mysql_real_escape_string($_POST['username']);
  $email=mysql_real_escape_string($_POST['email']);
  $password=mysql_real_escape_string($_POST['password']);
  $cpassword=mysql_real_escape_string($_POST['confirmpassword']);
  $query = mysql_query("inser into register values('', '$name', '$email', '$password',   '$cpassword')");
  if($query)
  {
      header("location:success.php");
  }
  }
  
  ?&gt;
      &lt;div class="register-form"&gt;
          &lt;h1&gt;Register&lt;/h1&gt;
          &lt;form action="" method="post"&gt;
              &lt;p&gt;&lt;label&gt;User Name: &lt;/label&gt;
              &lt;input type="text" id="username" name="username" placeholder="Username"&gt;
              &lt;/p&gt;
              &lt;p&gt;&lt;label&gt;E-Mail&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;/label&gt;
              &lt;input id="email" name="email" type="email"&gt;
              &lt;/p&gt;
              &lt;p&gt;&lt;label&gt;Password&amp;nbsp;&amp;nbsp; :&lt;/label&gt;
              &lt;input id="password" name="password" type="password"&gt;
              &lt;/p&gt;
              &lt;p&gt;&lt;label&gt;confirm Password &amp;nbsp;&amp;nbsp; :&lt;/label&gt;
              &lt;input id="confirmpassword" name="confirmpassword" type="password"&gt;
              &lt;/p&gt;
              &lt;input type="submit" name="submit" value="register" class="btn register"&gt;
              &lt;a class="btn" href="login.php"&gt;Login&lt;/a&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>After success in create a new page i redirect to success.php</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;success full&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Successfully registered&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>After i enter data, i click submit. i was echo and saw the sql queries, i am getting value but its not saving in phpmyadmin database. I am new to php, please help me to develop more php.
  Once again i am thank you.</p>