<?php
$hostname = '127.0.0.1';
$username = 'root';
$password = '';
$database = 'diki_portofolio';

$mysqli = new mysqli($hostname, $username, $password, $database);

if ($mysqli->connect_error) {
    echo "Connection failed: " . $mysqli->connect_error;
} else {
    echo "Connected successfully to database '$database'";
    $result = $mysqli->query("SHOW TABLES");
    echo "\nTables:\n";
    while ($row = $result->fetch_array()) {
        echo $row[0] . "\n";
    }
}
?>