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'";
Bookmarks