ADOdb: Connection StatementTag: adodb, database, database layer Category: PHP Databasepost: 29 Oct 2007 read: 2,545 In this tutorial, we discuss more deep about connection in php adodb. There are 2 connection in adodb: Connect() and PConnect(). Connect($host,[$user],[$password],[$database]) We have used in our practice in adodb introduction. Non-persistent connect to data source or server $host, using userid $user and password $password. If the server supports multiple databases, connect to database $database. The code like this:
If you are using a Microsoft ADO and not OLEDB, you can set the $database parameter to the OLEDB data provider you are using. PConnect($host,[$user],[$password],[$database]) Persistent connect to data source or server $host, using userid $user and password $password. If the server supports multiple databases, connect to database $database.
If you confuse pconnect() and connect(), below may be usefull: First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection. Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (ex, mysql_close() will not close links established by (ex, mysql_pconnect())). |
| | Give Your Opinion | Recommend |
|

