帮忙ASP翻译PHP

来源:百度知道 编辑:UC知道 时间:2024/06/25 02:36:02
<!--#include file=conn.asp -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>查询</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
</style>
</head>
<body>
<center>
<table style="position:absolute; left:160px; top:74px; width="975" border="0" align="center" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="205" height="156" valign="top"><p> </p>
<p><img src="./pic/leftmun1.gif" width="205" height="78" border="0" /><img src="./pic/leftmun2.gif" width="205" height=&q

你主要是数据显示的时候把ASP的还称PHP就OK了
吧你的这段改成我下面的那段就可以了
ASP:
<%do while not rs.eof%>
<td><% =rs ("表主名称") %></td>
<tr></tr>
<%

rs.movenext
loop
%>

PHP:

<?php
$conn = new com("adodb.connection");
$connstr="provider=microsoft.jet.oledb.4.0;data source=". realpath("aa.mdb");
$conn->open($connstr);
//if($connstr) echo "恭喜你,数据库连接成功!";
//else echo "数据库连接失败!";
$sql="select * from bb"; //查询tb_bookinfo表中的所有商品
$rs=new com("adodb.recordset"); //用com类声明一个记录集对象
$rs->open($sql,$conn,1,3); //利用com类的open()方法执行查询
while(!$rs->eof){
?>
<td><?php echo $rs->fields("id");?></td>
<tr></tr>
<?php
$rs->movenext;
}
?&g