include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection('postgres');
$conn->Connect('localhost', 'root', 'pass', 'mydb'); //连接PostgreSQL数据库
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection('mysql://root:1981427@localhost/test'); //连接MySQL数据库
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection('mysql');
$conn->Connect('localhost', 'root', '1981427', 'test'); //连接MySQL数据库
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection('mysql://root:1981427@localhost/test'); //连接数据库
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection(' postgres ');
$conn->Connect('host=localhost port=5432 dbname=mydb'); //连接PostgreSQL数据库
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection('postgres://root:pass@localhost/mydb'); //连接PostgreSQL数据库
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn = NewADOConnection('access'); //连接Access数据库
$conn->Connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\mydb.mdb;Uid=Admin;Pwd=;");
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn=NewADOConnection('odbc_mssql'); //连接SQL Server数据库
$conn->Connect("Driver={SQL Server};Server=localhost;Database=mydb;",'username','password');
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn=NewADOConnection('mssql'); //连接SQL Server数据库
$conn->Connect("localhost', 'username', 'password', 'mydb');
?>
include("adodb/adodb.inc.php"); //包含adodb类库文件
$conn=NewADOConnection('db2'); //连接DB2数据库
$conn->Connect("driver={IBM db2 odbc DRIVER};database=mydb;hostname=localhost;port=50000;
protocol=TCPIP;uid=root; pwd=pass");
?>
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn