Connect to Database

From UBot Studio
Revision as of 23:38, 5 December 2012 by LillyT (Talk | contribs)

Jump to: navigation, search

Connect to Database is a Database Command.

  • This command is used to open a connection to a database.
  • Currently it can only connect to MySQL, but more databases will be available in the future.
  • To interact with a database you will use this command, and drag in either the query command or query with results command.
  • You can use the wizard to setup the Connection Url parameter. The wizard also allows you to test the connection.


Example

plugin command("DatabaseCommands.dll", "connect to database", "server=localhost;uid=test; pwd=testing; database=mysql; port=3306; pooling=false") {
    plugin command("DatabaseCommands.dll", "query", "INSERT INTO users VALUES (\'ubot\', \'studio\');")
    plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM users WHERE username = \'ubot\';", &users)
}

File:Database.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox