Hi Jenny,
One way you could accomplish this is to do a query and query against the database field that you do not want to have a duplicate of. If the query returns no results then do the insert query and if the query returns a result don't do the insert query and show the error page. The code to do this using MySql would be:
$result = mysql_query("SELECT column_name FROM tablename WHERE field_to_be_checked = $value_to_be_checked_for",$link_name);
if (mysql_num_rows($result) >= 1) {
echo(" Your error message here ");
} else {
$insert = mysql_query("INSERT INTO tablename (field_1,field2) VALUES ($field_1_value,$field_2_value)",$link_name);
}
replace the $link_name with the name of the link to the database and the field names with the names for your fields. This will work for both checks.
Hope this helps