好的,所以我有这个代码:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpwd = 'ALLO';
$dbname = 'test';
$conn = mysqli_connect($dbhost, $dbuser, $dbpwd, $dbname);
if(! $conn )
{
die("\nconn: $conn \nCould not connect: " . mysqli_error($conn));
}
echo "\n";
$createtab="CREATE TABLE People(FirstName CHAR(30),LastName CHAR(30),Age INT)";
// Execute query
if (mysqli_query($conn,$createtab))
{
echo "Table created successfully";
}
else
{
echo "Error creating table: " . mysqli_error($conn);
}
echo "\n";
mysqli_query($conn,"INSERT INTO People (FirstName, LastName, Age)
VALUES ('Peter', 'Griffin',35)");
mysqli_query($conn,"INSERT INTO People (FirstName, LastName, Age)
VALUES ('Glenn', 'Quagmire',33)");
mysqli_close($conn)
?>
当我运行 php 脚本时,它运行良好。
但是,我在 mysql 工作台中找不到该表。
我刷新了很多次。
http://i.stack.imgur.com/uX1sQ.png http://i.stack.imgur.com/iEXqT.png