internetprogrammierung/dbConnect.php

18 lines
367 B
PHP
Raw Normal View History

<?php
2018-06-01 20:43:25 +02:00
//Create DB connection.
//This creates a usable "database" - Variable as mysqli Objekt
$user = 'root';
$password = 'Test';
$db = 'friendsbook';
$host = 'db';
2018-06-01 20:43:25 +02:00
$port = 3306;
$database = new mysqli($host, $user, $password, $db, $port);
if ($database->connect_error) {
die('Connect Error (' . $database->connect_errno . ') ' . $database->connect_error);
}
?>