Problem checking data in SQL table [closed]

1

I have the ragnarok database with the login table that has the userid (user) and user_pass (password) of the person. I'm trying to get the system into this table and make sure the field typed in the form matches what's in the database, however, php is always returning as if I'd typed the wrong field, and I'm typing correctly. .

Code php:

$query = "SELECT 'user_pass' FROM 'login' WHERE userid = '".$_SESSION["userid"]."'  ";
    $resultado = mysqli_query($conexao, $query) or die(mysqli_error($conexao));
    $campo = mysqli_fetch_array($resultado);
    if($campo)
    {
            echo "<div class='alert alert-danger' role='alert'>Senha atual errada!</div>";
    }

I do not know what else to do ..

    
asked by anonymous 05.03.2015 / 18:01

1 answer

0

I used the @RafaelWithoeft comment code. It was going wrong because I used the query SELECT 'user_pass' instead of SELECT user_pass . Many thanks to all who helped!

    
09.03.2015 / 21:37