<?php
// 连接到 MySQL 数据库 shopid
$host = "localhost";
$username = "shopid";
$password = "xxxxxxx";
$dbname = "shopid";
$conn = mysqli_connect($host, $username, $password, $dbname);
// 检查是否连接成功
if (!$conn) {
die("连接失败:" . mysqli_connect_error());
}
// 创建 mytable 表
$sql = "CREATE TABLE mytable (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30) NOT NULL
)";
if (mysqli_query($conn, $sql)) {
echo "mytable2 表已成功创建";
} else {
echo "创建表错误:" . mysqli_error($conn);
}
// 关闭数据库连接
mysqli_close($conn);
?>
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询