I want to add a code to this which will the make sure the user has added in a first name in the box and if not kick them out... i've tried serveral but none have worked... any ideas

PHP Code:

<?php 

$check 
"select id from members where username = '".$_POST['username']."';"
$qry mysql_query($check) or die ("Could not match data because ".mysql_error());
$num_rows mysql_num_rows($qry); 
if (
$num_rows != 0) { 
echo 
"Sorry, the username $username is already taken. Please go back and try another.<br>";


} else { 


$result mysql_query("insert into members (`id`,`username`,`firstname`,`lastname`,`dob`,`address`,`city`,`country`,`phone`,`email`,`password`,`nz_mailing`,`active`,`warriors_mailing`,`bcc_mailing`,`level`) values ('', '".$_POST['username']."','$firstname','$lastname','$dob','$address','$city','$country','$phone','$email','".$_POST['password']."','$nz_mailing','$active','$warriors_mailing','$bcc_mailing','$level')")
or die(
"Could not insert data because ".mysql_error());

print (
"Thanks for registering with [url]www.z.com[/url] <?php echo $firstname; ?> , we have sent you a email with instructions 
          on how to activate your account."
);

}

?>