<?php

    class Schema
    {
        private $con;


        public function __construct($con)
        {
            $this->con = $con;
        }


        public function selectAll($table)
        {
            $array = [];
            $sql = 'SELECT * FROM ' . $table;
            $res = $this->con->query($sql);
            while($row = $res->fetch_array())
            {
                $array[] = $row;
            }
            return $array;
        }


        public function executeQuery($sql, $types = null, $params = null)
        {
            $stmt = $this->con->prepare($sql);
            $stmt->bind_param($types, ...$params);

            if(!$stmt->execute()) return false;
            return $stmt->get_result();
        }


        

    }

    

?>