In our Backend course at school we gradually learned about working with MVC structure for PHP development.
Our basic 'template' consists of an index.php (which has routes to the pages & functions in the controller), controller folder (containing controllers), view folder and a DAO folder containing one for general acces to the database and files relative to each table in the database.
In this structure I have Controller and View but I wondered why we never use Model, we were never even told about it… Is the DAO what should be my Model folder?
Below is an example of DAO code for getting values from a products table, just to make it clear what I mean by DAO.
public function selectById($id) {
$sql = "SELECT * FROM `products` WHERE `id` = :id";
$stmt = $this->pdo->prepare($sql);
$stmt->bindValue(':id', $id);
$stmt->execute();
return $stmt->fetch(PDO::FETCH_ASSOC);
}