what would I need to add to get this password added as a MD5 format?

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.rugbyleaguenz.com[/url] <?php echo $firstname ?> , we have sent you a email with instructions 
          on how to activate your account."
);

}

?>