Query with Results
From UBot Studio
(Difference between revisions)
Line 14: | Line 14: | ||
} | } | ||
</pre> | </pre> | ||
+ | |||
+ | [[File:database.png]] |
Revision as of 23:32, 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) }