opensupports/version_upgrades/mysql_connect.php

16 lines
402 B
PHP
Raw Normal View History

2017-11-30 22:06:09 +01:00
<?php
2018-07-06 03:58:41 +02:00
require_once '../api/config.php';
2017-11-30 22:06:09 +01:00
2018-07-06 03:58:41 +02:00
$mysql_host = MYSQL_HOST;
$mysql_port = defined('MYSQL_PORT') ? MYSQL_PORT : '3306';
$mysql_user = MYSQL_USER;
$mysql_password = MYSQL_PASSWORD;
$mysql_db = MYSQL_DB;
2017-11-30 22:06:09 +01:00
2018-07-06 03:58:41 +02:00
$mysql = new mysqli($mysql_host, $mysql_user, $mysql_password, $mysql_db, $mysql_port);
2017-11-30 22:06:09 +01:00
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}