diff --git a/Plugins/Mineplex.ReportSite/view.php b/Plugins/Mineplex.ReportSite/view.php index f071026d2..29dc75b6c 100644 --- a/Plugins/Mineplex.ReportSite/view.php +++ b/Plugins/Mineplex.ReportSite/view.php @@ -41,13 +41,24 @@ $fullUrl = $parts[1]; $urlParts = explode('/', $fullUrl); $host = $urlParts[0]; + $port = 3306; + + // check is port has been declared + if (strpos($host, ':') !== false) + { + $hostParts = explode(':', $host); + $host = $hostParts[0]; + $port = $hostParts[1]; + } + $database = $urlParts[1]; $name = $parts[0]; $username = $parts[2]; $password = $parts[3]; - $connection = new mysqli($host, $username, $password, $database); + echo $port; + $connection = new mysqli($host, $username, $password, $database, $port); if ($connection->connect_error) { die("Connection \"$name\" failed: $connection->connect_error");