v5:reference:connection:adonewconnection
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:reference:connection:adonewconnection [2016/01/17 15:27] – ↷ Links adapted because of a move operation 184.99.209.82 | v5:reference:connection:adonewconnection [2020/12/08 10:39] (current) – better use PHP string concatenation for example instead of javascript's ;-) peterdd | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| <WRAP right box> | <WRAP right box> | ||
| - | == Syntax | + | == Syntax == |
| - | + | ||
| mixed adoNewConnection( | mixed adoNewConnection( | ||
| optional string $driverType='' | optional string $driverType='' | ||
| ) | ) | ||
| - | + | ||
| - | == Syntax version 6.0.0 == | + | |
| - | mixed adoNewConnection( | + | |
| - | string $driverType | + | |
| - | ) | + | |
| </ | </ | ||
| ===== Description ===== | ===== Description ===== | ||
| Line 31: | 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 44: | 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^Description^ | + | ^ Code ^ Driver |
| - | |new|true|[[v5: | + | | new | |
| - | |persist|true|[[v5: | + | | persist |
| - | |persistent|true|[[v5: | + | | persistent |
| - | |debug|true|[[v5: | + | | debug | |
| - | |role|string||When using the ibase driver, allows setting a role| | + | | port |
| - | |dialect|integer||Undocumented option| | + | | socket |
| - | |charset|string|[[v5: | + | | nls_date_format |
| - | |buffers|string||Undocumented option| | + | | cachesecs |
| - | |fetchmode|int|[[v5:reference:connection: | + | | memCache |
| - | |charpage|string||Undocumented option| | + | | memCacheHost |
| - | |clientflags|string||Undocumented option| | + | | memCachePort |
| - | |port|int||Sets the connection port| | + | | memCacheCompress |
| - | |socket|int||Sets the connection socket| | + | |
| - | |nls_date_format|string|Set date format| | + | |
| - | |cachesecs|int|Sets the number of cache seconds| | + | |
| - | |memcache|string||Undocumented series of options| | + | |
| ===== Error Codes ===== | ===== Error Codes ===== | ||
| - | As of version 6.0.0 , the following error codes will be returned if a connection | + | Note that, because no connection object is available, the codes cannot |
| - | ^Code^Description^ | ||
| - | |-1|An invalid driver name was given| | ||
| - | |-2|Unable to parse DSN string| | ||
| - | |-3|Connection to database via DSN string failed| | ||
| - | |-4|DSN option not supported by driver| | ||
| - | |||
| - | Note that, because no connection object is available, the codes cannot be retrieved via [[v5: | ||
v5/reference/connection/adonewconnection.1453040873.txt.gz · Last modified: (external edit)
