tildechan/core/database.php

14 lines
317 B
PHP
Raw Normal View History

<?php
// Load in the database variables
$path = $_SERVER['DOCUMENT_ROOT'];
2019-06-30 01:28:36 +00:00
require_once($path . "/core/config.php");
2019-06-30 01:28:36 +00:00
function get_database_conn() {
$conn= mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$conn) {
2019-06-30 01:28:36 +00:00
die('Could not connect to the database host!' . mysql_error());
}
return $conn;
}
?>