自己经常用来写测试用,又苦于经常找不到,索性记在这里方便日后查看
$con=mysqli_connect("localhost","root","root","demo");
if (mysqli_connect_errno($con))
{
echo "连接 MySQL 失败: " . mysqli_connect_error();
}
// 执行查询
mysqli_query($con,"SELECT * FROM websites");
mysqli_close($con);
网友评论