I have this code:
$checkDB = "SELECT email FROM users WHERE email='$email'";
$result = mysqli_query($conn, $checkDB);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
if (mysqli_num_rows($result) == 1) {
$errorEmail = 'This email is registered m8';
$mainError = true;
}
So the problem is that it always says that the email is registered even if it is not for the email check (email check is after name check). I tried changing variable names but it doesnt work.
$checkDB = "SELECT user_name FROM users WHERE user_name='$name'";
$result = mysqli_query($conn, $checkDB);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
if (mysqli_num_rows($result) == 1) {
$errorName = 'Name registered';
$mainError = true;
}