CopyCode The Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('Seconds s ');
$ Conn-> connect ('localhost', 'root', 'pass', 'mydb'); // connect to the PostgreSQL database
?>
Copy code The Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('mysql: // root: 1981427 @ localhost/test'); // connect to the MySQL database
?>
Copy code The Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('mysql ');
$ Conn-> connect ('localhost', 'root', '000000', 'test'); // connect to the MySQL database
?>
Copy code The Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('mysql: // root: 1981427 @ localhost/test'); // connect to the database
?>
Copy codeThe Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('Seconds s ');
$ Conn-> connect ('host = localhost Port = 5432 dbname = mydb'); // connect to the PostgreSQL database
?>
copy the Code the code is as follows: include ("ADODB/ADODB. inc. PHP "); // contains the ADODB class library file
$ conn = newadoconnection ('s s: // root: Pass @ localhost/mydb '); // connect to the PostgreSQL database
?> copy Code the code is as follows: include ("ADODB/ADODB. inc. PHP "); // contains the ADODB class library file
$ conn = newadoconnection ('access '); // connect to the ACCESS database
$ Conn-> connect ("driver = {Microsoft Access Driver (*. MDB)}; DBQ = D: \ mydb. MDB; uid = admin; Pwd =; ");
?> copy Code the code is as follows: include ("ADODB/ADODB. inc. PHP "); // contains the ADODB class library file
$ conn = newadoconnection ('odbc _ mssql '); // connect to the SQL Server database
$ Conn-> connect ("driver = {SQL Server}; server = localhost; database = mydb;", 'username ', 'Password');
?>
Copy codeThe Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('mssql'); // connect to the SQL Server database
$ Conn-> connect ("localhost", 'username', 'Password', 'mydb ');
?>
Copy codeThe Code is as follows: <? PHP
Include ("ADODB/ADODB. Inc. php"); // contains the ADODB class library file
$ Conn = newadoconnection ('db2 '); // connect to the DB2 database
$ Conn-> connect ("driver = {IBM DB2 ODBC driver}; database = mydb; hostname = localhost; Port = 50000;
Protocol = TCPIP; uid = root; Pwd = pass ");
?>