I have a signup form in which email id and mobile number present. If any one enter email and phone number then it will match from database table mobile and email. If email or mobile matches then if condition otherwise else condition. I tried but its not working.
if(isset($_POST["submit"]))
{
require"connection.php";
extract($_POST);
$result12=mysql_query("select mobile,email from mainaccount") or die (mysql_error());
while($row12=mysql_fetch_array($result12))
{
if($username==$row12["mobile"] || $email==$row12["email"])
{
echo"<b>Your Mobile number OR Email exists. Please use another Mobile number or Email!!!</b>";
die();
}
}
<form method="post" id="loginForm" name="loginForm" action="" onsubmit="return executeOnSubmit();">
<div class="col-lg-4">
Mobile No. <span style="color:red">*</span>
</div>
<div class="col-lg-8">
<input type="number" class="form-control" value="" name="username" id="username" required />
<div id="status"></div>
</div>
<div class="col-lg-4">
Email. <span style="color:red">*</span>
</div>
<div class="col-lg-8">
<input type="email" class="form-control" value="" name="email" id="email" required />
<div id="status"></div>
</div>
<div class="col-lg-12-pull-right">
<input type="submit" class="btn btn-success" value="Register" name="submit" />
<span style="margin-left:330px;"><b style="color:red">*</b> Means compulsary fields.</span>
</div>
</form>