<?php
// Database credentials
$dbname = 'hidil2609366';
$dbuser = 'hidil2609366';
$dbpass = 'Hidila123!';
$dbhost = '185.98.131.212'; // Important fix here

// Create connection using TCP/IP
$connect = new mysqli($dbhost, $dbuser, $dbpass, $dbname);

// Check connection
if ($connect->connect_error) {
    die("Connection failed: " . $connect->connect_error);
}

// Query to list tables
$test_query = "SHOW TABLES";
$result = $connect->query($test_query);

$tblCnt = 0;
if ($result) {
    while ($row = $result->fetch_array()) {
        $tblCnt++;
        // echo $row[0] . "<br>\n"; // Optional
    }
}

// Output result
if ($tblCnt === 0) {
    echo "There are no tables<br>\n";
} else {
    echo "There are $tblCnt tables<br>\n";
}

// Close connection
$connect->close();
?>
