PHP 8.4.6 Released!

ibase_service_attach

(PHP 5, PHP 7 < 7.4.0)

ibase_service_attachConnect to the service manager

Açıklama

ibase_service_attach(string $host, string $dba_username, string $dba_password): resource|false

Bağımsız Değişkenler

host

The name or ip address of the database host. You can define the port by adding '/' and port number. If no port is specified, port 3050 will be used.

dba_username

The name of any valid user.

dba_password

The user's password.

Dönen Değerler

Returns a Interbase / Firebird link identifier on success başarısızlık durumunda false döner.

Örnekler

Örnek 1 ibase_service_attach() example

<?php
/ Attach to the remote Firebird server by ip address
if (($service = ibase_service_attach('10.1.1.199', 'sysdba', 'masterkey')) != FALSE) {

/ Successfully attached.
/ Fetch server version (something like 'LI-V3.0.4.33054 Firebird 3.0')
$server_version = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);

/ Fetch server implementation (something like 'Firebird/Linux/AMD/Intel/x64')
$server_implementation = ibase_server_info($service, IBASE_SVC_IMPLEMENTATION);

/ Detach from server (disconnect)
ibase_service_detach($service);

/ Output the info
echo "Server version: " . $server_version . "<br/>";
echo
"Server implementation: " . $server_implementation;
}
else {
/ Output message on error
$conn_error = ibase_errmsg();
die(
$conn_error);
}

?>

Örnek 2 ibase_service_attach() example using hostname/port syntax

<?php
/ Attach to the remote Firebird server by name. Use Port 3050.
if (($service = ibase_service_attach('FB-SRV-01.contoso.local/3050', 'sysdba', 'masterkey')) != FALSE) {

/ Successfully attached.
/ Fetch server version (something like 'LI-V3.0.4.33054 Firebird 3.0')
$server_version = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);

/ Fetch server implementation (something like 'Firebird/Linux/AMD/Intel/x64')
$server_implementation = ibase_server_info($service, IBASE_SVC_IMPLEMENTATION);

/ Detach from server (disconnect)
ibase_service_detach($service);

/ Output the info
echo "Server version: " . $server_version . "<br/>";
echo
"Server implementation: " . $server_implementation;
}
else {
/ Output message on error
$conn_error = ibase_errmsg();
die(
$conn_error);
}

?>

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant