mysqli_stmt_get_result - Fatal error

0

I have an error in this line of code that I am not able to solve. I have looked in many forums and many say that it can be by the php version. I have been checking in the phpmyadmin of the server where I have it hosted and allows to use this function without any problem. Attachment code:

//subir a la base de datos
            $stmt = mysqli_stmt_init($conexion);

            //obtener id usuario 
            session_start();

            $email = $_SESSION['usuario_email'];
            $nombreUsuario = $_SESSION['usuario_nombre'];
            $apellidoUsuario = $_SESSION['usuario_apellido'];
            $telefono = $_SESSION['usuario_telefono'];

            $sql_id = "SELECT * FROM usuarios WHERE nombre='$nombreUsuario' and apellido='$apellidoUsuario' and telefono=$telefono";

            if (!mysqli_stmt_prepare($stmt, $sql_id)) {
                echo "SQL statement failed! Fallooo";
            }else{
                mysqli_stmt_execute($stmt);
                $result = mysqli_stmt_get_result($stmt);

                while($row = mysqli_fetch_assoc($result)){
                    $idUsuario = $row['id_usuario'];
                }
            }

The line that fails is this: $result = mysqli_stmt_get_result($stmt);

Where I add the following:

  

Fatal error: Call to undefined function mysqli_stmt_get_result ()

I hope you can help me, greetings.

    
asked by Oscar Plumariega 18.12.2018 в 09:48
source

0 answers