1、首先创建一个inedx.php文件,样式可以根据自己喜欢的样式调
<meta charset="utf-8">
<title>网站系统——交互渐进之简单信息系统</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
}
body {
background-image: url('images/images4.jpg'); /* 替换为你的图片路径 */
background-size: cover;
background-position: center;/*水平垂直居中 */
background-repeat: no-repeat;/*图片不重复 */
}
table{
border: 1px solid pink;
width: 700px;
text-align: center;
margin:auto;
color: red;
margin-top: 20px;
}
tr{
margin:90px auto;
}
th{
background-color: pink;
border: 1px solid pink;
}
td{
border: 1px solid pink;
}
a{
color: blue;
}
input{
color: red;
}
</style>
<form action="shousuo.php" method="post">
<table>
<tr>
<td colspan="8">请选择你要查询的字段
<select name="ziduan" style="color: red">//ziduan=字段
<!--style="color: palevioletred"修改option标签里面的文字颜色-->
<option value="id" style="color: green">id</option>
<option value="major" style="color: palevioletred">major</option>
<option value="class" style="color: orange">class</option>
<option value="student_id" style="color: #007BFF">student_id</option>
<option value="name" style="color: brown">name</option>
<option value="grade" style="color: darkgrey">grade</option>
<option value="birthday" style="color: salmon">birthday</option>
</select>
请输入你要查询的内容
<input type="text" name="neirong">
<input type="submit" value="搜索" name="selsub"">
</td>
</tr>
</table>
</form>
<table>
<form action="#" method="post">
<tr>
<th>ID</th>
<th>专业</th>
<th>班级</th>
<th>学号</th>
<th>姓名</th>
<th>性别</th>
<th>出生日期</th>
<th>操作</th>
</tr>
<?php
$link = mysqli_connect('localhost','lyx1082','lyx1082','lyx1082','3306');
echo $link?'':'数据库连接失败';
mysqli_query($link,"set names utf8");
$query = "select * from students";
$result = mysqli_query($link,$query)or die("执行语句失败");
$count = 0;
while($arr = mysqli_fetch_assoc($result)){
$count++;
$alt = ($count % 2)?"alt":"";
echo
"<tr clas