Modules/MTA-MySQL/mysql select db
Jump to navigation
Jump to search
This function is provided by the external module MTA-MySQL. You must install this module to use this function. | |
Changes the current default database.
Syntax
bool mysql_select_db ( MySQLConnection handler, string database )
Required arguments
- handler: A valid MySQL link
- database: The new database name
Returns
It it succeeds returns true, in other case returns false
Example
Example 1: This example changes the current default database to another one
local handler = mysql_connect("localhost", "user", "password", "mta_users") if ( not mysql_select_db(handler, "another_database") ) then outputDebugString("Unable to change default database: (" .. mysql_errno(handler) .. ") " .. mysql_error(handler)) end
See also
- mysql_connect
- mysql_close
- mysql_errno
- mysql_error
- mysql_ping
- mysql_select_db
- mysql_escape_string
- mysql_affected_rows
- mysql_change_user
- mysql_get_character_set_info
- mysql_get_client_info
- mysql_get_client_version
- mysql_get_host_info
- mysql_get_proto_info
- mysql_get_server_info
- mysql_get_server_version
- mysql_hex_string
- mysql_info
- mysql_insert_id
- mysql_query
- mysql_unbuffered_query
- mysql_set_character_set
- mysql_stat
- mysql_warning_count