当前位置:Gxlcms > 数据库问题 > 数据库查看详细信息操作

数据库查看详细信息操作

时间:2021-07-01 10:21:17 帮助过:2人阅读

<?php
include_once"connect.php";

if(!$_GET[‘ud‘])
{
    echo "wrong";//如果未传值过来,则显示错误
}
$ud=$_GET[‘ud‘];
$sql="select * from stu where stu_id=$ud";
$re=mysql_query($sql);

?>
<html>
<head>
<title>show</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<center>
<body>
<table border="1" width=‘30%‘>
<tr align="center ">学生详细信息</tr>
<tr>
	<td>编号</td>
	<td>姓名</td>
	<td>年龄</td>
	<td>性别</td>
</tr>

<?php
mysql_query("set names utf8");
while($row=mysql_fetch_assoc($re))
{
?>	<tr>
	<td><?php echo $row[‘stu_id‘];?></td>
	<td><?php echo $row[‘stu_name‘];?></td>
	<td><?php echo $row[‘stu_sex‘];?></td>
	<td><?php echo $row[‘stu_age‘];?></td>
	</tr>

<?php	
}
?>
	
<?php
mysql_close($conn);
?>
</table>
<a href=‘table.php‘><input name="return" type="button" value="返回" ></a>
</body>
</center>
</html>


到此,一个超小型的项目就完成了,还需多多体会其中的方法和思想!!

 

数据库查看详细信息操作

标签:

人气教程排行