I have made a web based and mobile app that has a basic profile function. I was working well few weeks ago now it's pretty weird both apps can't log me in even with correct inputs. I didn't change anything in the codes so I doubt it's the problem and I have checked it millions of times.

The URL are correct everythings fine with the code what and the database is still there. I'm thinking it's a problem with the database itself.I am using XAMPP is a scenario like this possible?

I have tried turning off the xampp server but it only causes an endless loop on verifying the account

Any tips on what I should do?

login.php for my mobile app


$username = $_POST['username'];
$passFromForm = $_POST['password'];
$query_search = "select username from accounts where username = '".$username."' AND user_role = 'Employee'";
$query_exec = mysql_query($query_search) or die(mysql_error());
$rows = mysql_num_rows($query_exec);

 if($rows == 1) { 
    $query_search = "select password from accounts where username = '".$username."' LIMIT 1";
    $result = mysql_query($query_search) or die(mysql_error());
    $row = mysql_fetch_array($result);  
    $passFromDB = $row[0];  
    if(password_verify($passFromForm, $passFromDB)){
             echo "0"; 
            echo "1";

 else  {
    //while($role = mysql_fetch_assoc($query_exec)){
    //  $result = $role['role'];
    //if($result == "Employee"){
        echo "1";
    //} else {
    //  echo "1";


Related posts

Recent Viewed