maxdb_real_connect
maxdb->real_connect
Opens a connection to a MaxDB server
&reftitle.description;
Procedural style
boolmaxdb_real_connect
resourcelink
stringhostname
stringusername
stringpasswd
stringdbname
intport
stringsocket
Object oriented style (method)
maxdb
bool
real_connect
stringhostname
stringusername
stringpasswd
stringdbname
intport
stringsocket
maxdb_real_connect attempts to establish a
connection to a MaxDB database engine running on
hostname.
This function differs from maxdb_connect:
maxdb_real_connect needs a valid resource which has
to be created by function maxdb_init
With function maxdb_options you can set various options for connection.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
Object oriented style
options(MAXDB_UNICODE, "FALSE");
$maxdb->options(MAXDB_TIMEOUT, 5);
/* connect to server */
$maxdb->real_connect('localhost', 'MONA', 'RED', 'DEMODB');
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s\n", maxdb_connect_error());
exit();
}
printf ("Connection: %s\n.", $maxdb->host_info);
$maxdb->close();
?>
]]>
Procedural style
]]>
The above examples would produce the following output:
]]>
&reftitle.seealso;
maxdb_connect
maxdb_init
maxdb_options
maxdb_ssl_set
maxdb_close