blob: df7b560456ef9851ef72cc8a1afc0bef04c69323 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001OPTIONAL
2SYNOPSIS
3 int db_connect(string database)
4 int db_connect(string database, string user)
5 int db_connect(string database, string user, string password)
6
Zesstra715ec202025-07-09 22:18:31 +02007DESCRIPTION
8 Connect to the database <database> on the local mySQL-server.
9 The return-value is the handle for this connection. Automatic
10 reconnects are enabled for this connection; see mysql(C) for
11 implications.
12 If the database does not exist or the server is NOT started,
13 a runtime-error is raised.
MG Mud User88f12472016-06-24 23:31:02 +020014
Zesstra715ec202025-07-09 22:18:31 +020015 If specified, the connection is made for <user> with <password>.
MG Mud User88f12472016-06-24 23:31:02 +020016
Zesstra715ec202025-07-09 22:18:31 +020017 The function is available only if the driver is compiled with
18 mySQL support. In that case, __MYSQL__ is defined.
MG Mud User88f12472016-06-24 23:31:02 +020019
Zesstra715ec202025-07-09 22:18:31 +020020 The efun triggers a privilege violation ("mysql", "db_connect").
MG Mud User88f12472016-06-24 23:31:02 +020021
Zesstra715ec202025-07-09 22:18:31 +020022HISTORY
23 Added in 3.2.9 .
24 LDMud 3.2.11 added the privilege violation.
MG Mud User88f12472016-06-24 23:31:02 +020025
Zesstra715ec202025-07-09 22:18:31 +020026SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020027 db_affected_rows(E), db_conv_string(E), db_close(E), db_coldefs(E),
28 db_exec(E), db_error(E), db_fetch(E), db_handles(E),
29 db_insert_id(E), mysql(C), privilege_violation(M)