Scripting/Squirrel/Functions/mysql connect: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary |
|||
Line 23: | Line 23: | ||
You can also remotely connect to a MySQL database, replace "localhost" with the remote host IP and make sure the host accepts remote connections. | You can also remotely connect to a MySQL database, replace "localhost" with the remote host IP and make sure the host accepts remote connections. | ||
== Related Functions == | |||
{{Scripting/Squirrel/Functions/Mysql}} | |||
[[Category:Scripting/Squirrel/Functions/Mysql_Functions]] |
Revision as of 18:23, 30 January 2017
This function will connect to a MySQL database on the server.
Syntax
mysql_connect( host, dbuser, dbpassword, dbname);
Arguments
- host - The host of the MySQL database (Most cases "localhost")
- dbuser - The MySQL user name.
- dbpassword - The MySQL user password.
- dbname - The MySQL database name.
Example
function onScriptLoad()
{
db <- mysql_connect( "localhost", "vcmp", "test123", "vcmpdb");
}
Notes
You can also remotely connect to a MySQL database, replace "localhost" with the remote host IP and make sure the host accepts remote connections.