I'm creating a login system in Unity, and it works to login with a username from the database, but the login is successful no matter what I type into the password field. I don't understand why, as I thought this code would check whether the password match with the username or not. Any clues? I'm btw very new to PHP. Thanks :)
php code:
$check = mysql_query("SELECT * FROM unitytut WHERE `user`='$user'");
$numrows = mysql_num_rows($check);
while($row = mysql_fetch_assoc($check)){
if($pass = $row['pass']){
die("login-SUCCESS");
}
}
unity code:
WWWForm form = new WWWForm ();
form.AddField ("user", user);
form.AddField ("pass", pass);
WWW w = new WWW ("http://mywebpage.dx.am/Login.php", form);
StartCoroutine (Login (w));
IEnumerator Login(WWW w){
yield return w;
if (w.error == null) {
if(w.text == "login-SUCCESS"){
Debug.Log("LOGIN SUCCESS");
}
}