init()

Description

int id init (string host [, string user, string password])

Initialize the connection to the given host with the given parameters.

This method has to be called prior to any other method as it populates the object with the required information, and at the same time prepares PHP/YAZ for the upcoming search statements.

Examples

Simple example of initializing a connection to the local database without user information. As it can be seen, the default host is the local zebra server, so no server needs to be specified.


$search = new Search;
$search->init();

... perform searches ....

Example of initializing a connection to the Library of Congress, which needs no login information.


$search = new Search;
$search->init("z3950.loc.gov:7090/voyager");

... perform searches ...

Last an example of a connection to an arbitrary server with login information supplied.


$search = new Search;
$search->init("some.host.com", "username", "abc123");

... perform searches ...