My Sign Up fields are not inserting into the database, just rows are incremented.
HTML markup:
    <body><h1 class="headingStyle">Sign Up</h1>
        <form action="SignUp.php" method="post">
        <table width="284" border="1" align="center">
      <tr>
        <td width="128" class="style1">User Name</td>
        <td width="144"><input type="text" name="u_name" id="u_name"></td>
      </tr>
      <tr>
        <td class="style1">Email</td>
        <td><input type="text" name="email" id="email"></td>
      </tr>
      <tr>
        <td class="style1">Password</td>
        <td><input type="password" name="pass" id="pass"></td>
      </tr>
      <tr>
        <td colspan="2" class="buttonStyle"><input type="submit" name="submit" value="Sign Up"></td>
      </tr>
    </table>
    </form>
    </body>
This is the php code, it is not inserting anything to my table just incrementing the rows. I have given the snapshot of my table as well.
<?php
$conn = mysql_connect("localhost", "root", "") or die(mysql_error());
$db = mysql_select_db('aartycrafty_db', $conn) or die(mysql_error());
if (isset($_POST['submit'])) /*if sign up button is pressed than */
{
    $name = $_POST['u_name'];
    $email = $_POST['email'];
    $pass = $_POST['pass'];
    if($name == '')
    {
        echo "<script>alert('Please Enter Your Name')</script>";
        exit();
    }
    if($email == '')
    {
        echo "<script>alert('Please Enter Your Email')</script>";
        exit();
    }
    if($pass == '')
    {
        echo "<script>alert('Please Enter Your Password')</script>";
        exit();
    }
}
else {
    $query = "insert into signup_tb (u_name, u_email, u_pass) values ('$name', '$email', '$pass')";
    if(mysql_query($query)){
        echo "<script>window.open('home.php')</script>";
    }
}
?>
 
    