Skip to main content

db_connect

Discworld driver help

db_connect

WARNING!!!!

Avoid using this on discworld at all costs. Please see db.h and mysql.c for information on how to use this. Use DB_HANDLER from db.h

Name

db_connect() - initiate a connection to a database

Synopsis

int db_connect( string host, string database, void | string user,
void | string password );

Description

Do not use this! See warning above.

db_connect() initiates a connection to a database, `database' being the name of the database and `host' the hostname of the computer running the database server. If `user' is omitted, the username of the the person running the game driver is used to connect. If `password' is omitted, it is assumed that no password is needed to connect to the database.

db_connect() returns a new database handle on success, a runtime error occurs otherwise.

Errors

The runtime errors which may occur depend on the database engine used in the game driver.

See also

db_close(), db_exec(), db_fetch()