SW/assets/php/dao.php

24 lines
591 B
PHP
Raw Normal View History

2021-04-26 22:40:34 +02:00
<?php
class DAO {
//Atributes:
public $mysqli;
//Constructor:
public function __construct($bd_name){
2021-05-08 15:17:51 +02:00
if($bd_name != BD_NAME) {
echo "Está intentando acceder a una base de datos que no existe, puede que la aplicación no funcione correctamente";
2021-04-26 22:40:34 +02:00
}
2021-05-08 15:17:51 +02:00
$app = Aplicacion::getSingleton();
$this->mysqli = $app->conexionBd();
2021-04-26 22:40:34 +02:00
}
2021-05-08 15:17:51 +02:00
//Destructor (Ya no es necesdario):
/*
2021-04-26 22:40:34 +02:00
public function __destruct(){
$this->mysqli->close();
}
2021-05-08 15:17:51 +02:00
*/
2021-04-26 22:40:34 +02:00
}
?>