Versions available for this page: CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 |
The cubrid_connect_with_url() function tries to connect a database by using connection information passed with an url string argument. If the HA feature is enabled in PHP, you must specify connection information of the active server and connection information of the standby server, which is used for failover when failure occurs, in the url string argument of this function. If it has succeeded, the ID of connection handle is returned; if it fails, an error code is returned.
resource cubrid_connect_with_url(string $conn_url[, string $db_user, string $db_password ])
<conn_url> ::=cci:cubrid:<host>:<db_name>:<db_user>:<db_password>:[?<properties>]
<properties> ::= <property> [&<property>]
<property> ::= autocommit=<autocommit_mode>
<property> ::= althosts=<alternative_hosts> [&rctime=<time>]
<alternative_hosts> ::= <standby_broker1_host>:<port> [,<standby_broker2_host>:<port>]
<host> := HOSTNAME | IP_ADDR
<time> := SECOND
<?php
$con = cubrid_connect_with_url("cci:CUBRID:localhost:33000:demodb:dba::?autocommit=true");
?>