あなたの質問があまりにも幅広いですが、ここにあなたが実行できる照会mysqliのいくつかの可能なPHPのリストです:
<?php
$host = "localhost"; // Replace localhost with your mysql host provider
$username = "username"; // Replace username with your mysql username
$password = "password"; // Replace username with your mysql password
// Create connection
$conn = new mysqli($host, $username, $password);
// Check if mysql connects
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// To Create a new database
$sql = "CREATE DATABASE yourDBname"; // Replace yourDBname with the desired database name
if ($conn->query($sql) === TRUE) {
echo "Database created successfully";
} else {
echo "Error creating database: " . $conn->error;
}
// To Display all databases
$sql = "SHOW DATABASES";
$result = $conn->query($sql);
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
var_dump($row);
}
}
else{
echo "There are no Databases found";
}
// To Delete a database
$sql = 'DROP DATABASE yourDBname';
if ($conn->query($sql) === TRUE) {
echo "Database deleted successfully";
} else {
echo "Error deleting database: " . $conn->error;
}
// Its always better to close your mysql connection
$conn->close();
?>
あなたは$のSQLが= "SHOWデータベース" 'てみました; '? –
[類似の質問](https://stackoverflow.com/questions/5240732/how-to-show-mysql-databases-on-a-php-script) –
@GarbageCollector質問の下に「フラグ」をクリックし、重複して、リンクを投稿してください。それは自動的にコメントを生成し、他のユーザーに見せるためにコメントします。 – GrumpyCrouton