PHP与mysql交互渐进之简单信息系统,仅供参考

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值