21,893
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>综合素质</title>
<link rel="stylesheet" type="text/css" href="index.css">
<script src="jquery-2.1.3.js"></script>
<script src="index.js"></script>
</head>
<?PHP
$con = mysql_connect("localhost","root","");
mysql_select_db("radom100",$con);
session_start();
$sql = "select * from user2";
$result = mysql_query($sql);
$arr = array();
while($row = mysql_fetch_array($result)){
$arr[] = $row;
}
$txt = '';
foreach($arr as $key){
$txt = '<tr>
<td width="4%" style=" text-align:center;">'.$key['id'].'</td>
<td width="77%">'.$key['choice'].'</td>
<td width="19%">'.$key['select'].'</td>
</tr>';
}
?>
<body>
<table width="80%" align="center" border="1px" cellpadding="10" cellspacing="2">
<tr>
<th style="font-family: 楷体; font-size: 20px;">编号</th>
<th style="font-family:楷体; font-size: 40px;">题目</th>
<th width="19%" style="font-family:楷体; font-size:28px;">答案</th>
</tr>
<?PHP echo $txt; ?>
<tr>
<td width="4%"> </td>
<td width="77%"> </td>
<td width="19%"> </td>
</tr>
</table>
</body>
</html>