首页上一页 1 下一页尾页 1 条记录 1/1页
php操作adodb类库出现若干问题
发表在PHP图书答疑
2012-07-25
是否精华
是
否
版块置顶:
是
否
<?php
include "adodb5/adodb.inc.php";
$conn = ADONewConnection('access');
$conn->PConnect("Driver= {Microsoft Access Driver (*.mdb)};Dbq=".realpath("bbs.mdb"));
$rs=$conn->execute("select * from jj");
while($rs){echo $rs->fields[0];
$rs->movenext();
}
//问题:上段代码为什么读不出任何内容,总是显示处理超时
/*$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath("bbs.mdb");
$conn->Open($connstr);
$sql="select * from jj";
$rs = new com("ADODB.RecordSet");
$rs->Open($sql,$conn,1,1);
while(!$rs->eof) {
echo $rs->Fields(1)." ".$rs->fields[2]."<br>";
$rs->MoveNext();
}
问题:上段代码使用的命令是来自adodb类库吗,有通用性吗?
echo $rs->RecordCount(); //取记录总*/数
/*include "adodb5/adodb.inc.php";
$conn=adonewconnection('mysql');
$conn->debug=true;
$conn->Connect("localhost","root","jh811015","jj");
$ADODB_FETCH_MODE=adodb_fetch_assoc;
$conn->execute("set names utf8");
$rs=$conn->execute("select * from 用户信息");
while(!$rs->eof){echo $rs->fields[0];
$rs->movenext();}*/
//问题:上段代码为什么数据库名不能是中文的,我用mysql_connect可以用中文做数据库名和表名
?>
include "adodb5/adodb.inc.php";
$conn = ADONewConnection('access');
$conn->PConnect("Driver= {Microsoft Access Driver (*.mdb)};Dbq=".realpath("bbs.mdb"));
$rs=$conn->execute("select * from jj");
while($rs){echo $rs->fields[0];
$rs->movenext();
}
//问题:上段代码为什么读不出任何内容,总是显示处理超时
/*$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath("bbs.mdb");
$conn->Open($connstr);
$sql="select * from jj";
$rs = new com("ADODB.RecordSet");
$rs->Open($sql,$conn,1,1);
while(!$rs->eof) {
echo $rs->Fields(1)." ".$rs->fields[2]."<br>";
$rs->MoveNext();
}
问题:上段代码使用的命令是来自adodb类库吗,有通用性吗?
echo $rs->RecordCount(); //取记录总*/数
/*include "adodb5/adodb.inc.php";
$conn=adonewconnection('mysql');
$conn->debug=true;
$conn->Connect("localhost","root","jh811015","jj");
$ADODB_FETCH_MODE=adodb_fetch_assoc;
$conn->execute("set names utf8");
$rs=$conn->execute("select * from 用户信息");
while(!$rs->eof){echo $rs->fields[0];
$rs->movenext();}*/
//问题:上段代码为什么数据库名不能是中文的,我用mysql_connect可以用中文做数据库名和表名
?>