Query with Results
From UBot Studio
(Difference between revisions)
(Created page with "$Query with Results is a Database Command. - This command is used for running a query against a database and returning the results into a table. - It is...") |
|||
| Line 1: | Line 1: | ||
$Query with Results is a [[Database Commands|Database Command]]. | $Query with Results is a [[Database Commands|Database Command]]. | ||
| − | + | * This command is used for running a query against a database and returning the results into a table. | |
| − | + | * It is only usable inside of a connect to database Command. | |
| − | + | * The Query parameter is used for typing your SQL query such as SELECT * FROM table_name; | |
| − | + | * The Table parameter is used for defining the table where the results of your query will be stored. | |
| + | |||
| + | == Example == | ||
| + | |||
| + | <pre> | ||
| + | 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) | ||
| + | } | ||
| + | </pre> | ||
Revision as of 23:29, 5 December 2012
$Query with Results is a Database Command.
- This command is used for running a query against a database and returning the results into a table.
- It is only usable inside of a connect to database Command.
- The Query parameter is used for typing your SQL query such as SELECT * FROM table_name;
- The Table parameter is used for defining the table where the results of your query will be stored.
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)
}