Hi folks, I have been creating a php form that also has a confirmation page...However, when I successfully add information, the final result is not being added to database...is my syntax incorrect?

<?php

//Check to see if the form was submitted
if ($submit) {

//Sets the intial error flag to 0
$error = 0;

//If name was submitted empty set $error = 1 and add error msg to errors array
if (!$contactname) {
$error = 1;
$errors[] = "Missing Contact Name";
}
//If email was submitted empty set $error = 1 and add error msg to errors array
if (!$email) {
$error = 1;
$errors[] = "Missing Email";
}

//If data had no errors
if ($error == 0) {$dbcnx = @mysql_connect(
"localhost", "XXXXXX", "XXXXXXXX");
mysql_select_db("XXXXXXXXXX");

$sql = "INSERT INTO Database SET "
"E_Mail='$email', " .
"Contact_Name='$contactname', " .

}

}
?>
<html>
<head>
<title>Untitled</title>
</head>

<body>
<?

//Check to see if either the form wasn't submitted or there was an error and display the form
if (!$submit || ($error == 1)) {

print '<h2>Sample Form</h2>';
//If $error = 1 loop through the errors array and print each error
if ($error == 1) {
print "<ul>";
while (list ($key, $val) = each ($errors)) {
printf('<li>%s', $val);
}
print "</ul>";
}
printf('<form action="%s" method="post">', $PHP_SELF);

printf('Email: <input type="text" name="contactname" value="%s"><br>', $contactname);
printf('Email: <input type="text" name="email" value="%s"><br>', $email);
printf('<input type="submit" name="submit" value="submit">');
print '</form>';
}

//If no errors print the confirmation page
else {
printf('Thank you %s, your information was submitted successfully', $contactname);
}


?>



</body>
</html>