直接上模板
//调节php编码
header("Content-Type: text/html;charset=utf-8");
//假设test(sno(int),sname(char))表
$conn=mysqli_connect('127.0.0.1','root','password','database_name');
//查询
$result=mysqli_query($conn,"select * from test");
while($row = $result->fetch_assoc()) {
echo $row['sno'];
echo $row['sname'];
}
//修改没有返回值
mysqli_query($conn,"sql语句");