0
嗨朋友試圖顯示錯誤,因爲用戶名已存在或電子郵件存在,而註冊使用PHP。這裏是我的代碼..如何顯示錯誤,因爲用戶名存在或電子郵件存在使用PHP而註冊
if (isset($_POST['username']) && isset($_POST['password'])){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$unique_user = "SELECT * FROM `user` where username='$username' or email='$email'";
$unique_result = mysqli_query($mysql, $unique_user);
if(mysqli_num_rows($unique_result)>0)
{
echo "try again";
}
現在是重新打印的嘗試,但我怎麼能檢查是否是用戶名或電子郵件已經存在
上午存儲用戶名,電子郵件,數據庫密碼 –