cubrid_connect_with_url

Description

The cubrid_connect_with_url function tries to connect a database by using connection information passed with an url string argument. If CUBRID HA 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.

Syntax

resource cubrid_connect_with_url (string $conn_url [, string $db_user, string $db_password[, bool $new_link]])

 

<conn_url> ::= cci:cubrid:<host>:<db_name>:<db_user>:<db_password>:[?<properties>]

<properties> ::= <property> [&<property>]

<property> ::= login_timeout=<milli_sec>

<property> ::= query_timeout=<milli_sec>

<property> ::= disconnect_on_query_timeout=true|false

<property> ::= autocommit=<autocommit_mode>

<property> ::= althosts=<alternative_hosts> [ &rctime=<time>]

<alternative_hosts> ::= <host>:<port> [,<host>:<port>]

<host> := HOSTNAME | IP_ADDR

<time> := SECOND

Return Value
Example

<?php

$con = cubrid_connect_with_url("cci:CUBRID:localhost:33000:demodb:dba::?autocommit=true");

?>

Remark

Because a colon (:) and a question mark (?) is used as a separator in URL string, it is not allowed to include them for password of URL string. To use them, you must specify a user name (db_user) and a password (db_password) as a separate parameter.