I cannot figure out what the issue is with my PHP but the INSERT function seems to fail at all times. I have the correct table rows listed but there could just be a simple syntax issue. If that code is needed, I can supply it also. Here's my PHP and database structure:

<?php
$con = mysql_connect('***','***','***');
if (!$con)
{
echo "Failed to make connection.";
exit;
}
$db = mysql_select_db('***');
if (!$db)
{
echo "Failed to select db.";
exit;
}
$username = $_POST['username'];
$password = $_POST['password'];
$name = $_POST['name'];
$email = $_POST['email'];
$sql = "SELECT username,email FROM Users WHERE username = '" . $username . "' OR email = '" . $email . "'";
$query = mysql_query($sql);
if (mysql_num_rows($query) > 0)
{
echo "That username or email already exists";
}
else
{
$insert = "INSERT INTO Users(username,password,name,email) VALUES ('" . $username . "','" . $password . "','" . $name . "','" . $email . "')";
$query = mysql_query($insert);
if ($query)
{
echo "Thanks for registering. You may now login.";
}
else
{
echo "Insert failed";
}
}
?>
$insertputecho $insert. it will display your mysql query. copy/paste this query in phpmyadmin and see which error is. then post it here, so it will be easier to see where the problem is