<?php
$mysqli = new mysqli('localhost', 'USER', 'PASSWORD', 'BASENAME');
if ($mysqli->connect_error) {
die('Connection error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
}
echo '<p>Connection established... ' . $mysqli->host_info . "</p>";
$result = $mysqli->query("SHOW TABLES;");
while ($row = $result->fetch_row()) {
echo "<p>Table: {$row[0]}</p>";
}
echo 'MySQL server version: ' . $mysqli->server_info . "\n";
$mysqli->close();
?>