'; // Selecting a database // Unnecessary in this case because we have already selected // the right database with the connect statement. mysqli_select_db($dbcon, $database) or die('Could not select database'); print 'Selected database successfully!
'; // Listing tables in your database $query = 'SHOW TABLES'; $result = mysqli_query($dbcon, $query) or die('Show tables failed: ' . mysqli_error()); print "The tables in $database database are:
"; // Printing table names in HTML print ''; // Free result mysqli_free_result($result); // Closing connection mysqli_close($dbcon); ?>