php registration file error... can't find it.
<p>Been lookin at this all night and I give up... 
The code is going straight from $result to the last line, so something is failing</p>

<p>Nothing is on the error log
Doesn't display an error message when it dies.
Just goes straight to reg_fail.html</p>

<pre><code>&lt;?php

$host = '.......'; // Host Name
$sql_username = '......'; // Sql Username
$sql_password = '.......'; // Password
$db_name = '..............'; //Database Name


$con = mysql_connect($host, $sql_username, $sql_password)or die('Error connecting to server');
mysql_select_db( $db_name)or die('Error connecting to database');


$firstName = mysql_real_escape_string($_POST['regFirstName']);
$lastName = mysql_real_escape_string($_POST['regLastName']);
$username = mysql_real_escape_string($_POST['regUser']);
$email = mysql_real_escape_string($_POST['regEmail']);

$password = mysql_real_escape_string($_POST['regPassword']);
$password = md5($password);

$query = "SELECT * FROM user WHERE username = '$username'";
$result = mysql_query($query) or die($query."&lt;br/&gt;&lt;br/&gt;".mysql_error());


if($result){

$count = mysql_num_rows($result);

if($count == 0){

    try{        



    $query = "INSERT INTO user (username, password, first_name, last_name, email)
                                 VALUES ('$username', '$password', '$firstName', '$lastName', '$email')";


    mysql_query($query , $con); 

    header('location: registration_success.html');  

    }catch(Exception $e){
    header('location: registration_fail_userTaken.html');
    }

}

header('location: registration_fail_userTaken.html');

}

header('location: registration_fail.html'); 




?&gt;
</code></pre>
