PHP Doku:: Is used to establish the environment for connecting to your server - function.cubrid-connect.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenCubridCubrid Funktionencubrid_connect

Ein Service von Reinhard Neidl - Webprogrammierung.

Cubrid Funktionen

<<cubrid_connect_with_url

cubrid_current_oid>>

cubrid_connect

(PECL CUBRID >= 8.3.0)

cubrid_connectIs used to establish the environment for connecting to your server

Beschreibung

resource cubrid_connect ( string $host , int $port , string $dbname [, string $userid [, string $passwd ]] )

The cubrid_connect() function is used to establish the environment for connecting to your server by using your server address, port number, database name, user name, and password. If the user name and password is not given, then the "PUBLIC" connection will be made by default.

Calling the cubrid_connect() function does not necessarily make the connection to your server. The actual connection will be made when an operation is requested by using the connection handle.

Parameter-Liste

host

Host name or IP address of CAS server.

port

Port number of CAS server (BROKER_PORT configured in $CUBRID/conf/cubrid_broker.conf).

dbname

Name of database.

userid

User name for the database.

passwd

User password.

Rückgabewerte

Connection identifier, when process is successful.

FALSE, when process is unsuccessful.

Beispiele

Beispiel #1 cubrid_connect() example

<?php
$con 
cubrid_connect ("210.211.133.100"12345"demodb");

if (
$con) {
   echo 
"connected successfully";
   
$req =cubrid_execute($con"insert into person values(1,’James’)");

   if (
$req) {
      
cubrid_close_request ($req);
      
cubrid_commit ($con);
   } else {
      
cubrid_rollback ($con);
   }
   
cubrid_disconnect ($con);
}
?>

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)