ajout connexion

This commit is contained in:
Noah 2026-06-05 10:44:13 +02:00
parent 2eb333edfb
commit cf97e02c21
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,3 @@
<?php
unset($connex);
?>

14
models/connection.php Normal file
View file

@ -0,0 +1,14 @@
<?php
/**
* Create a PDO connection
* @return PDO
*/
function connection() {
//Loads config from file config.php
require('config/config.php');
//Db connection
$connex = new PDO('mysql:host=' . HOST . ';dbname=' . DB,USER , PASSWORD);
return $connex;
}

View file