Thanks to everyone that has tried to help me, but my form will still not insert any data into database. I have included your suggestions and have even cut and pasted the format from other php forms in the tutorial. What am I doing wrong, or what is missing?

Thanks!
----------------------------
<?

//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 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", "XXXXXXx", "XXXXXX");
mysql_select_db("XXXXXX");
$inserted = mysql_query("$sql");
$sql = "INSERT INTO Business 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('Name: <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', $name);
}


?>



</body>
</html>