手记

第一个php页面

<html>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />

<title>第一个PHP页面-zzarea.com</title>

</head>


<body>

<?PHP

$conn=mysql_connect ("localhost:3306", "root", "111");

mysql_select_db("hx_2013",$conn);



$sql = 'select * from t_info ';

$result = mysql_query($sql);


echo "<table border='1'>

<tr>

<th>t_id</th><th>t_name</th><th>t_age</th><th>t_sex</th>

</tr>";

while ($row = mysql_fetch_array($result))


{                      echo "<tr>";

echo "<td>" . $row['t_id'] . "</td>";

echo "<td>" . $row['t_name'] . "</td>";

echo "<td>" . $row['t_age'] . "</td>";

echo "<td>" . $row['t_sex'] . "</td>";

   echo "</tr>";

}


echo "</table>";


?>

</body>

</html>


0人推荐
随时随地看视频
慕课网APP