Run a select query before your insert query to see if the value exists already:
$qrycheck = mysql_query("SELECT * FROM table WHERE field1 = '$variable1passed' AND field2 = '$variable2passed'");
$qrycount = mysql_num_rows($qrycheck);
If ($qrycount != '0'):
// Put some message here to let the user know it already exists
Else:
// Do your insert query here...
Endif;