[Solved] How to make login with userid or mobile number using php mysql [closed]


Change this;

$query=mysql_query("select * from users where userId='$uname' and pwd ='$pwd' ");

to:

$query=mysql_query("SELECT * FROM users WHERE pwd ='$pwd' AND (userId = '$uname' OR PhoneNum = '$uname')");

What this does it will take both $uname value and search both Userid column and Phone Num column for a match. Please note that PhoneNum is the column name in your table.

Also your database is at risk for attack. MYSQL Injections.

2

solved How to make login with userid or mobile number using php mysql [closed]