登 录
//php 操作类源代码:
http://blog.csdn.net/andylin02/archive/2009/02/05/3864843.aspx
//调用页面代码
<?php require_once("db.php"); ?> <html> <head> <!--set title--> <title> </title> </head> <!--show page--> <body> <?php echo "localhost"; $objDb = new CDb("root", "", "test", "localhost"); $objDb->OpenDb(); $result = $objDb->Execut("select * from stu;"); if (!$result) { echo "exectu sql failed! <br>/n"; exit(0); } echo "id/tname/tsex/taddr <br>/n"; while ($row = mysql_fetch_array($result)) { echo "" . $row['id'] . "/t" . $row['name'] . "/t" . $row['sex'] . "/t" . $row['address'] . "<br>/n"; } ?> </body> </html>
抱歉!评论已关闭.