$con = mysql_connect("localhost","root","密码")
if (!$con){die('Could not connect: ' . mysql_error())}
mysql_select_db("wexeditor", $con)
mysql_query("set names utf8")
$result = mysql_query("SELECT name,tel,kd,dh,datetime FROM student")
echo "<table border='1'>"
while($row = mysql_fetch_array($result)){
echo "<tr>"
echo "<td>".$row['name']."</td>"
echo "<td>".$row['tel']."</td>"
echo "<td>".$row['kd']."</td>"
echo "<td>".$row['dh']."</td>"
echo "<td>".date("Y-m-d",$row['datetime'])."</td>"
echo "</tr>"
}
echo "</table>"
mysql_close($con)
?>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)