Firebird 2.0
PHP5 Programming
Manual

FBIRD_ADD_USER

Purpose

Use the fbird_add_user function to add a new user to the Firebird security database.

Syntax

<add_user> ::=
   fbird_add_user(svc_hndl, user, passwd
                  [, first [, middle [, last]]])


Element 
Type
Description
svc_hndl
resource
Valid service handle
user
string
User login name
passwd
string
User password
first
string
User first name, optional
middle
string
User middle name, optional
last
string
User last name, optional
<return>
Bool
True if successfully completed

Semantics

This function adds a new user to the Firebird security database. Only a service handle associated with the SYSDBA user can it be used for adding new users.

The user name string can be up to 31 characters long. The password string can also be up to 31 characters long, but only the first 8 characters are significant.

The function returns True is the new user identity was successfully created, otherwise it returns false.

Example

The below example creates a new user 'peterpan' with password 'pp':

// attach to the server with proper privileges
if (($service = fbird_service_attach('localhost', 'sysdba',
                'masterkey')) == FALSE) {
   $ib_error = fbird_errmsg();
}

//add a new user with name 'peterpan' and password 'pp'
if (($result = fbird_add_user($service, 'peterpan', 'pp')) != FALSE) {
   echo 'User created';
}
else {
   $ib_error = fbird_errmsg();
}
fbird_service_detach($service);



See also

service_attach, modify_user, delete_user


previous page goto index next page

Legal information