ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:adonewconnection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
v5:reference:connection:adonewconnection [2017/04/14 10:22]
dregad [Table] fix table layout
v5:reference:connection:adonewconnection [2017/04/15 18:41]
mnewnham
Line 3: Line 3:
 <WRAP right box> <WRAP right box>
 == Syntax == == Syntax ==
-  ​+
   mixed adoNewConnection(   mixed adoNewConnection(
       optional string $driverType=''​       optional string $driverType=''​
   )   )
- +
 </​WRAP>​ </​WRAP>​
 ===== Description ===== ===== Description =====
Line 27: Line 27:
 include '​adodb.inc.php';​ include '​adodb.inc.php';​
 /* /*
- * Simple connection +* Simple connection 
- */+*/
 $driver = '​mysqli';​ $driver = '​mysqli';​
 $db     = adoNewConnection($driver);​ $db     = adoNewConnection($driver);​
 /* /*
- * Now connect to the database +* Now connect to the database 
- */+*/
 $db->​connect('​localhost','​user','​password','​employees'​);​ $db->​connect('​localhost','​user','​password','​employees'​);​
 </​code>​ </​code>​
Line 40: Line 40:
 include '​adodb.inc.php';​ include '​adodb.inc.php';​
 /* /*
- * Set DSN +* Set DSN 
- */+*/
 $driver = '​mysqli';​ $driver = '​mysqli';​
 $DSN    = "​user:​password@localhost/​employees";​ $DSN    = "​user:​password@localhost/​employees";​
 $db     = adoNewConnection($driver + '://'​ + $DSN); $db     = adoNewConnection($driver + '://'​ + $DSN);
 /* /*
- * Now connected +* Now connected 
- */+*/
 </​code>​ </​code>​
 ===== Additional Parameters To DSN connection ==== ===== Additional Parameters To DSN connection ====
Line 68: Line 68:
 | nls_date_format ​ | string ​                                                            || Set date format ​                                    | | nls_date_format ​ | string ​                                                            || Set date format ​                                    |
 | cachesecs ​       | int                                                                || Sets the number of cache seconds ​                   | | cachesecs ​       | int                                                                || Sets the number of cache seconds ​                   |
-memcache ​        | string ​                                                            || Undocumented series ​of options ​                     ​|+memCache ​        | false    ​[[v5:​userguide:​memcached|memcache]] ​                    | Enables memcache library for caching ​                               | 
 +| memCacheHost ​    | array    | [[v5:​userguide:​memcached|memcache]] ​                    | Array of one or more memcached servers ​                             | 
 +| memCachePort ​    | int      | [[v5:​userguide:​memcached|memcache]] ​                    | Optional alternative port to connect to memcache server(s) ​         | 
 +| memCacheCompress | false    | [[v5:​userguide:​memcached|memcache]] ​                    | Enables memcache compression (not supported with memcached library) ​|
  
 ===== Error Codes ===== ===== Error Codes =====
 Note that, because no connection object is available, the codes cannot be retrieved via [[v5:​reference:​connection:​errormsg|errorMsg()]] Note that, because no connection object is available, the codes cannot be retrieved via [[v5:​reference:​connection:​errormsg|errorMsg()]]
 +
  
v5/reference/connection/adonewconnection.txt · Last modified: 2020/01/11 22:57 by mnewnham