<?php

require_once "conexion.php";

class ModeloGlobal
{
    public static function mdlSelect($tabla, $id)
    {
        $conexion = new Conexion();

        $db = $conexion->get_connection();

        $sql = "SELECT * FROM " . $tabla . " WHERE id_" . $tabla . " = :id ";

        $stmt = $db->prepare($sql);

        $stmt->bindParam(":id", $id);

        $stmt->execute();

        $response = ($stmt->rowCount() >= 1) ? $stmt->fetch(PDO::FETCH_ASSOC) : false;

        $db = null;
        
        return $response;
    }
}
