ibase_service_attach

(PHP 5, PHP 7 < 7.4.0)

ibase_service_attachConnect to the service manager

Description

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

Parameters

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.

Return Values

Returns a Interbase / Firebird link identifier on success or false on failure.

Examples

Example #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($serviceIBASE_SVC_SERVER_VERSION);

        
// Fetch server implementation (something like 'Firebird/Linux/AMD/Intel/x64')
        
$server_implementation ibase_server_info($serviceIBASE_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);
    }

?>

Example #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($serviceIBASE_SVC_SERVER_VERSION);

        
// Fetch server implementation (something like 'Firebird/Linux/AMD/Intel/x64')
        
$server_implementation ibase_server_info($serviceIBASE_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);
    }

?>

See Also

Here you can write a comment


Please enter at least 10 characters.
Loading... Please wait.
* Pflichtangabe
There are no comments available yet.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Category: Software & Web-Development

PHP cURL Tutorial: Using cURL to Make HTTP Requests

cURL is a powerful PHP extension that allows you to communicate with different servers using various protocols, including HTTP, HTTPS, FTP, and more. ...

TheMax

Autor : TheMax
Category: PHP-Tutorials

Midjourney Tutorial - Instructions for beginners

There is an informative video about Midjourney, the tool for creating digital images using artificial intelligence, entitled "Midjourney tutorial in German - instructions for beginners" ...

Mike94

Autor : Mike94
Category: KI Tutorials

Publish a tutorial

Share your knowledge with other developers worldwide

Share your knowledge with other developers worldwide

You are a professional in your field and want to share your knowledge, then sign up now and share it with our PHP community

learn more

Publish a tutorial