i want to add a line which will give a error if the user has left a selected field blank! any ideas
also why does it add my password as normal tex? how do i add it as md5 ??
<?php
mysql_connect (localhost, user, pass);
mysql_select_db (table);
?>
<?php
$qry = ("SELECT * FROM members WHERE username = '".$_POST['username']."'");
$countusername = mysql_num_rows($qry);
// If the count is bigger than 0, echo an error, otherwise continue with the script.
If($countusername > 0){
echo "That username is already in our database. Please go back andd try a different username.";
} 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('','$username','$firstname','$lastname','$dob','$address','$city','$country','$phone','$email','$password','$nz_mailing','$active','$warriors_mailing','$bcc_mailing','$level')") or die("INSERT error: ".mysql_error());
}
?>