P
PHP
Well-known member
- Beiträge
- 997
- Punkte Reaktionen
- 0
Returns a connection to a database
Creates a new connection to an IBM DB2 Universal Database, IBM Cloudscape,or Apache Derby database.
Rückgabewert:
For an uncataloged connection to a database,databaserepresents a complete connectionstring in the following format
ATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=password;where the parameters represent the following values:
Beispiel:
Creates a new connection to an IBM DB2 Universal Database, IBM Cloudscape,or Apache Derby database.
Rückgabewert:
For an uncataloged connection to a database,databaserepresents a complete connectionstring in the following format
Beispiel:
PHP:
$database = 'SAMPLE';
$user = 'db2inst1';
$password = 'ibmdb2';
$conn = db2_connect($database, $user, $password);
if ($conn) {
echo "Connection succeeded.";
db2_close($conn);
}
else {
echo "Connection failed.";
}