php-dev-container-starter/app/public/function/conf.inc.php
2024-02-16 09:01:27 +01:00

17 lines
No EOL
439 B
PHP

<?php
/*
Ajmi Yasmin, 13.02.2024
Verbindung DB und Schema
*/
try{
$server = 'db'; //Port der DB, standard 3306, kann auch weggelassen werden
$user = 'root';
$pwd = 'ALEPH';
$schema = 'school';
$con = new PDO('mysql:host='.$server.';dbname='.$schema.';charset=utf8', $user, $pwd);
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch(Exception $e){
echo $e->getCode().': '.$e->getMessage();
}