v5:reference:connection:adonewconnection
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
v5:reference:connection:adonewconnection [2017/04/14 10:22] – [Table] fix table layout dregad | v5:reference:connection:adonewconnection [2020/01/11 22:49] – [Table] mnewnham | ||
---|---|---|---|
Line 3: | Line 3: | ||
<WRAP right box> | <WRAP right box> | ||
== Syntax == | == Syntax == | ||
- | | + | |
mixed adoNewConnection( | mixed adoNewConnection( | ||
optional string $driverType='' | optional string $driverType='' | ||
) | ) | ||
- | + | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
Line 27: | Line 27: | ||
include ' | include ' | ||
/* | /* | ||
- | * Simple connection | + | * Simple connection |
- | */ | + | */ |
$driver = ' | $driver = ' | ||
$db = adoNewConnection($driver); | $db = adoNewConnection($driver); | ||
/* | /* | ||
- | * Now connect to the database | + | * Now connect to the database |
- | */ | + | */ |
$db-> | $db-> | ||
</ | </ | ||
Line 40: | Line 40: | ||
include ' | include ' | ||
/* | /* | ||
- | * Set DSN | + | * Set DSN |
- | */ | + | */ |
$driver = ' | $driver = ' | ||
$DSN = " | $DSN = " | ||
$db = adoNewConnection($driver + '://' | $db = adoNewConnection($driver + '://' | ||
/* | /* | ||
- | * Now connected | + | * Now connected |
- | */ | + | */ |
</ | </ | ||
===== Additional Parameters To DSN connection ==== | ===== Additional Parameters To DSN connection ==== | ||
The following additional parameter can be added to the DSN connection string. Some of the parameters only work with specific drivers. | The following additional parameter can be added to the DSN connection string. Some of the parameters only work with specific drivers. | ||
- | ^ Code ^ Value ^ Parameter | + | ^ Code ^ Driver |
- | | new | true | [[v5: | + | | new | |
- | | persist | + | | persist |
- | | persistent | + | | persistent |
- | | debug | true | [[v5: | + | | debug | |
- | | role | + | | role | ibase |
- | | dialect | + | | dialect |
- | | charset | + | | charset |
- | | buffers | + | | buffers |
- | | fetchmode | + | | fetchmode |
- | | charpage | + | | charpage |
- | | clientflags | + | | clientflags |
- | | port | + | | port | mysqli, postgres9 |
- | | socket | + | | socket |
- | | nls_date_format | + | | nls_date_format |
- | | cachesecs | + | | cachesecs |
- | | memcache | + | | memCache |
+ | | memCacheHost | ||
+ | | memCachePort | ||
+ | | memCacheCompress | ||
===== Error Codes ===== | ===== Error Codes ===== | ||
Note that, because no connection object is available, the codes cannot be retrieved via [[v5: | Note that, because no connection object is available, the codes cannot be retrieved via [[v5: | ||
+ | |||
v5/reference/connection/adonewconnection.txt · Last modified: 2020/12/08 10:39 by peterdd