i've googled for an answer, but the results i've found give me the idea that this isn't something for which the cause is easily identified, so of course i'm turning to phpbuilder.com
i've created a very simple data collection form. the MySQL db table has 6 fields. an auto_incrementing int for the primary key, then 3 varchars for first, last name, and e-mail, an INT for phone number, and a TEXT for comments.
the form has 5 fields, each appropriate for the datatype (including a <textarea> for the comments). the form is on index.php and its action goes to a file named thanks.php so i can confirm to the user that their info was in fact entered into the db by echoing back the $POST data submitted by the form action.
i also have an IF statement set to check for existence of $POST data sent from the form in a required field, Email-- since it's the critical bit of data, if it's empty, the index.php page is loaded again.
however, all of this is not working, and my error is "Duplicate entry '' for key 2"
here's the code from the thanks.php page, where most of the parsing takes place. the only thing on the other page is the form, and i always make it successfully to the thanks.php page.
<?php
$conn = mysql_connect("localhost", "private", "private");
mysql_select_db("seminar", $conn) or die(mysql_error());
if ($_POST['EMAIL'] = "") {
$url = "index.php";
header("Location: $url");
exit;
} else {
$inquery = "INSERT into interest values ('', '$_POST[F_NAME]', '$_POST[L_NAME]', '$_POST[EMAIL]',
'$_POST[PHONE]', '$_POST[REMARK]')";
mysql_query($inquery, $conn) or die(mysql_error());
$htmlblock = "<h3>the following was recorded by your entry:</h3>
<p>First Name: '$_POST[F_NAME]'</p>
<p>Last Name: '$_POST[L_NAME]'</p>
<p>e-Mail: '$_POST[EMAIL]'</p>
<p>Phone: '$_POST[PHONE]'</p>
<p>Remarks: '$_POST[REMARK]'</p>";
}
?>
<p>
<?php
echo $htmlblock;
?>
</p>
i realize this is probably something very silly that i'm missing here! thanks for taking a look at this for me!