<?php
header("content-type:text/html;charset=utf-8");
$conn=mysql_connect('localhost','root','root') or die('数据库连接失败!');
mysql_select_db('student');
mysql_query('set names utf8');
$rs=mysql_query("select * from stu_grade");
echo "<table width='900' border='1' bordercolor='blue'>";
echo "<tr>";
echo "<th>ID</th>";
echo "<th>姓名</th>";
echo "<th>分数</th>";
echo "</tr>";
while ($row=mysql_fetch_row($rs)) {
echo "<tr>";
echo "<td>{$row[0]}<td>";
echo "<td>{$row[1]}<td>";
echo "<td>{$row[2]}<td>";
echo "</tr>";
}
echo "</table>";
?>
慕姐4208626