v5:reference:connection:connect
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
reference:connect [2015/07/26 01:05] – mnewnham | v5:reference:connection:connect [2016/09/21 14:34] – [Usage] fix code sample dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== connect ====== | ====== connect ====== | ||
+ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[database: | + | [[v5:database: |
== Syntax == | == Syntax == | ||
mixed connect( | mixed connect( | ||
Line 15: | Line 16: | ||
===== Description ===== | ===== Description ===== | ||
The essential function '' | The essential function '' | ||
+ | ------------------------------------- | ||
^ 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. If the connection fails, the value is set to false. | ||
+ | |||
+ | To debug the connection, set the value '' | ||
+ | ------------------------------------------ | ||
+ | ===== Usage ===== | ||
+ | <code php> | ||
+ | /* | ||
+ | | ||
+ | */ | ||
+ | include ' | ||
+ | /* | ||
+ | * This is not a class below | ||
+ | */ | ||
+ | $db = newADOConnection(' | ||
+ | |||
+ | /* | ||
+ | * Make a connection to a database on the local machine | ||
+ | */ | ||
+ | $db-> | ||
+ | |||
+ | </ |
v5/reference/connection/connect.txt · Last modified: 2023/05/07 10:37 by dregad