//processShowData.php
查询数据库表信息$link=mysql_connect("localhost","root","root");
mysql_select_db("rorely");
$exec="select * from test";
$result=mysql_query($exec);
while($rs=mysql_fetch_object($result)){
$id=$rs->id;
$name=$rs->name;
$age=$rs->age;
$sex=$rs->sex;
$address=$rs->address;
?>
<?php echo $id ?><?php echo $name ?><?php echo $age ?><?php echo $sex ?><?php echo $address ?>}
mysql_close();
?>
结果:
学号
姓名
年龄
性别
地址
1
Jane
26
female
wenming cun 123#
3
Tome
21
male
wenming cun 32#
4
Lily
25
female
wenming cun 2#
5
Lucy
25
female
wenming cun 2#
6
Jim
22
male
wenmin cun 45#
7
Jim
22
male
wenmin cun 45#
8
Jim
22
male
wenmin cun 45#
9
Jim
22
male
wenmin cun 45#
10
Jim
22
male
wenmin cun 45#
11
Jim
22
male
wenmin cun 45#
12
Jim
22
male
wenmin cun 45#
13
Jim
22
male
wenmin cun 45#
14
Jim
22
male
wenmin cun 45#
15
Jim
22
male
wenmin cun 45#
18
Jim
22
male
wenmin cun 45#
20
Jim
22
male
wenmin cun 45#
78
lili
22
female
wenming cun 23#
79
hj
30
male
wenming cun 23#
80
hj
30
male
wenming cun 23#