internetprogrammierung/~dbConnect.php

18 lines
432 B
PHP
Raw Normal View History

2018-06-01 20:43:25 +02:00
<?php
//Create DB connection.
//This creates a usable "database" - Variable as mysqli Objekt
//simply remove the "~" in front of the filename
$user = 'user';
$password = 'password';
$db = 'database name';
$host = 'ip or domain';
$port = 3306;
$database = new mysqli($host, $user, $password, $db, $port);
if ($database->connect_error) {
die('Connect Error (' . $database->connect_errno . ') ' . $database->connect_error);
}
?>