2024-11-07 17:55:20
mysqli_query($conn,"set name gbk");//少了个参数
2024-11-07 10:56:59
少了必须参数
mysqli_query(connection,query,resultmode);
// 假定数据库用户名:root,密码:123456,数据库:RUNOOB $con=mysqli_connect("localhost","root","123456","RUNOOB");
if (mysqli_connect_errno($con)) {
echo "连接 MySQL 失败: " . mysqli_connect_error();
}
// 执行查询mysqli_query($con,"SELECT * FROM websites");mysqli_query($con,"INSERT INTO websites (name, url, alexa, country)
VALUES ('百度','https://www.baidu.com/','4','CN')");
mysqli_close($con);