Entry query in PHPMYSQLI

0

Hi what happens I am making an entry for a php page, but I want that in the login form only login to the user who identifies with admin and password 12345, everything is registered in the database.

$resultados = mysqli_query($conexion,"SELECT * FROM $tabla_db2 WHERE user='$user' AND pass='$pass' ");
        while($consulta = mysqli_fetch_array($resultados)) {
               $_SESSION['sesion_exito']=1;//Inicio Sesion :D
            }

With this code if you give me income, for any user that is in the database but I want to make it more specific to give access only to an administrator does not give me the income.

$resultados = mysqli_query($conexion,"SELECT * FROM $tabla_db2 WHERE user='admin' AND pass='12345' ");
        while($consulta = mysqli_fetch_array($resultados)) {
               $_SESSION['sesion_exito']=1;//Inicio Sesion :D
            }
    
asked by Julián Franco 31.05.2018 в 17:12
source

0 answers