v5:reference:connection:connect
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
reference:connect [2015/07/26 03:50] – mnewnham | v5:reference:connection:connect [2023/05/07 10:37] (current) – Better return value description (boolean, not mixed) dregad | ||
---|---|---|---|
Line 3: | Line 3: | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[database: | + | [[v5:database: |
== Syntax == | == Syntax == | ||
- | mixed connect( | + | bool connect( |
| | ||
| | ||
Line 15: | Line 15: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The essential function '' | + | |
+ | The essential function '' | ||
+ | |||
+ | Since ADOdb 5.21,0, some database drivers support the use of [[v5: | ||
+ | |||
+ | The traditional description of the connection parameters is as follows: | ||
^ Parameter 1 ^ Parameter 2 ^ Parameter 3 ^ Parameter 4 ^ | ^ Parameter 1 ^ Parameter 2 ^ Parameter 3 ^ Parameter 4 ^ | ||
| $hostName | | $hostName | ||
- | However the actual values of the parameters for some databases are such that the actual requirements can be confusing. See the [[database: | + | However the actual values of the parameters for some databases are such that the actual requirements can be confusing. See the [[v5:database: |
+ | |||
+ | If the connection is made, $db becomes a database connection object that can be used until the script ends. | ||
+ | |||
+ | === Return value === | ||
+ | |||
+ | The method returns //true// if the connection was successfully established, | ||
+ | |||
+ | To debug the connection, set the value '' | ||
------------------------------------------ | ------------------------------------------ | ||
===== Usage ===== | ===== Usage ===== | ||
Line 25: | Line 39: | ||
/* | /* | ||
| | ||
- | */ | + | */ |
include ' | include ' | ||
/* | /* | ||
Line 35: | Line 49: | ||
* Make a connection to a database on the local machine | * Make a connection to a database on the local machine | ||
*/ | */ | ||
- | $db-> | + | $db-> |
- | /* | ||
- | * If the connection is made, $db becomes a database connection object that can be used until the script ends. | ||
- | */ | ||
</ | </ |
v5/reference/connection/connect.1437875430.txt.gz · Last modified: 2017/04/21 11:36 (external edit)