Error validating existing user in the DB with PHP

0

What a good day, when trying to validate a user in PHP I execute the var_dump () function and it returns bool (false) which is incorrect since I am entering a user that does exist in the database so which should show me true, it took several days trying to solve this and nothing. Next I leave my code waiting for you to help me. THANK YOU.

The database is the following:

    
asked by Guillermo Ricardo Spindola Bri 10.05.2016 в 21:00
source

3 answers

1

I have other annotations to add to what my stack colleagues comment.

  
  • Check that the connection to BD is being made correctly, as you were told the default port is 3306.
  •   
  • Once you are successful with the connection you go to the execution of your SQL query to see if you are really doing it from a   correct way.
  •   
  • Finally you pass to test your php code.
  •   
        
    answered by 07.08.2016 в 09:16
    1

    Hello watching your code from line 26 to line 30, where you make the query I do not see anywhere where you define ': user' I also see that your query is incorrect as it should be:

    $usuario=$_SESSION['usuario'];
    SELECT * FROM t_usuarios WHERE usuario='$usuario' LIMIT 1;
    

    On the other hand I see that the port for the connection to Mysql is different and it should be the Port: 3306, as Jose tells you

        
    answered by 19.08.2016 в 20:25
    0

    Have you verified with an echo the value that the $ user variable is receiving ?; Another point, what is the var_dump returning you could you copy the result?

    You can confirm if the MYSQL server is actually running on port 8080, since this is usually used by a TOMCAT server

    With that information I think I could help you,

    Greetings

        
    answered by 10.05.2016 в 22:58