数据库中有一个表test为:id name age
$sql="select * from test where age=20";
$result=mysql_query($sql);
echo "<table border='1' cellspacing=0px>
<tr>
<th>id</th>
<th>name</th>
<th>age</th>
</tr>";
while ($row=mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['age']."</td>";
echo "</tr>";
}
echo "</table>";
守着星空守着你
相关分类