shopping-list/php/connect.php

20 lines
396 B
PHP
Raw Normal View History

2018-10-24 15:00:27 +02:00
<?php
include $_SESSION["docroot"].'/config/config.php';
2021-08-16 15:22:29 +02:00
$mysqli = mysqli_init();
$mysqli->real_connect(
$CONFIG['host'],
$CONFIG['username'],
$CONFIG['passwd'],
$CONFIG['database']
3306,
NULL,
MYSQLI_CLIENT_SSL
2018-10-24 15:00:27 +02:00
);
2019-06-03 16:46:59 +02:00
$mysqli->set_charset("utf8mb4");
2018-10-24 15:00:27 +02:00
if (!is_null($mysqli->connect_error))
{
header("Location: /error/DBConnFailed");
exit;
}
?>