This:
$check_result = mysql_query($check);
Should almost always be written as this:
$check_result = mysql_query($check) or die(mysql_error());
That way if your SQL is wrong it'll tell you. Otherwise you just get "invalid result resource" error later on in the program.
In this case though, I would suggest this:
$check_result = mysql_query($check) or $failed = true;
Then you can just check to see if the $failed variable is set true.