db2_connect

Diskutiere db2_connect im PHP Forum im Bereich Programmierung; Returns a connection to a database Creates a new connection to an IBM DB2 Universal Database, IBM Cloudscape,or Apache Derby database...
  • db2_connect Beitrag #1
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:DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=password;where the parameters represent the following values:

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.";
}
 
Thema:

db2_connect

Oben Unten