This would be a piece of my code.
$name = $_POST['UserNames'];
$pw = sha1($_POST['Passwords']);
$mail = $_POST['Emails'];
$pc = $_POST['Postcodes'];
$status = "0";
mysql_query("INSERT INTO userinfo
(Username,Password,Email,Postcode,status,valid)
VALUES
('$name','$pw','$mail','$pc','$status','$validate')
");
How do i make sure every input will not be null and the Email will never repeat.