<html> <head> </head> <body> <?php $c=mysql_connect("localhost","root",""); if ($c) { echo "connect database successfully!"."<br />"; mysql_select_db("family",$c); $result="select * from f"; $k=mysql_query($result); echo "<table border='1'><tr> <th>name</th> <th>born</th> <th>age</th></tr>"; while ($row = mysql_fetch_row($k)) { echo "<tr><td>"."$row[0]"."</td><td>"."$row[1]"."</td><td>"."$row[2]"."</td></tr>"; } echo "</table>"; } else { echo "fail to connect to database!"."<br />"; } ?> </body> </html>