Does not show data in the select query

0

good morning, I have this query for my front of users, with PDO connection but in SQL SERVER but it does NOT show me any result as if it had nothing in the user table, but when I make an insert it is possible to insert the new user . What could be happening? greetings and thanks

static public function QuerysUsers($table, $item, $value) {

    if ($item != null) {
        $stmt = ConexionPDODb::connectDataBase()->prepare("select * from $table WHERE $item = :$item");
        $stmt->bindParam(":" . $item, $value, PDO::PARAM_STR);

        $stmt->execute();

        return $stmt->fetch();


    } else {

        $stmt = ConexionPDODb::connectDataBase()->prepare("select * from $table");

        $stmt->bindParam(":" . $item, $value, PDO::PARAM_STR);

        $stmt->execute();

        return $stmt->fetchAll();            

    }

    $stmt->close();

    $stmt = null;

    /* =====  Consulta de Usuarios  ====== */
}
    
asked by Misael 02.01.2019 в 11:04
source

0 answers